Skip to content

Commit

Permalink
properly revert extend
Browse files Browse the repository at this point in the history
  • Loading branch information
at2005 committed Oct 1, 2024
1 parent fce5c7d commit 6c52cb2
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/lib/buy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ interface SfBuyOptions {
start?: string;
yes?: boolean;
quote?: boolean;
extend?: Array<string>;
colocate_with?: Array<string>;
}

export function registerBuy(program: Command) {
Expand Down Expand Up @@ -81,7 +81,9 @@ async function buyOrderAction(options: SfBuyOptions) {
}

// parse colocation contract id and assign it if it exists
const colocateWithContractIds = options.extend ? options.extend : [];
const colocateWithContractIds = options.colocate_with
? options.colocate_with
: [];
if (colocateWithContractIds) {
// check if contract actually exists
for (const contractId of colocateWithContractIds) {
Expand Down Expand Up @@ -325,7 +327,10 @@ function confirmPlaceOrderMessage(options: BuyOptions) {
);
const pricePerHourLabel = c.green(centsToDollarsFormatted(pricePerGPUHour));

const colocated_with = options.colocate_with.length === 0 ? "" : ` colocated with ${options.colocate_with.join(", ")}`;
const colocated_with =
options.colocate_with.length === 0
? ""
: ` colocated with ${options.colocate_with.join(", ")}`;
const topLine = `${totalNodesLabel} ${instanceTypeLabel} ${nodesLabel} (${GPUS_PER_NODE * options.quantity} GPUs${colocated_with}) at ${pricePerHourLabel} per GPU hour for ${c.green(durationHumanReadable)} ${timeDescription}`;

const dollarsLabel = c.green(centsToDollarsFormatted(pricePerGPUHour));
Expand Down

0 comments on commit 6c52cb2

Please sign in to comment.