Skip to content

Commit eaee66c

Browse files
committed
Make amount to deposit optional.
1 parent 59e1cda commit eaee66c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/cli.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ export async function createCLI() {
226226
.option('--maxJobDuration <maxJobDuration>', 'Compute maxJobDuration')
227227
.option('-t, --token <paymentToken>', 'Compute payment token')
228228
.option('--resources <resources>', 'Compute resources')
229-
.option('--amountToDeposit <amountToDeposit>', 'Amount to deposit in escrow')
229+
.option('--amountToDeposit [amountToDeposit]', 'Amount to deposit in escrow')
230230
.action(async (datasetDids, algoDid, computeEnvId, initializeResponse, maxJobDuration, paymentToken, resources, amountToDeposit, options) => {
231231
const dsDids = options.datasets || datasetDids;
232232
const aDid = options.algo || algoDid;
@@ -236,14 +236,16 @@ export async function createCLI() {
236236
const token = options.token || paymentToken;
237237
const res = options.resources || resources;
238238
const amount = options.amountToDeposit || amountToDeposit;
239-
if (!dsDids || !aDid ||!envId || !initResp || !jobDuration || !token || !res || !amount) {
239+
if (!dsDids || !aDid ||!envId || !initResp || !jobDuration || !token || !res) {
240240
console.error(chalk.red('Missing required arguments'));
241241
// process.exit(1);
242242
return
243243
}
244244
const { signer, chainId } = await initializeSigner();
245245
const commands = new Commands(signer, chainId);
246-
await commands.computeStart([null, dsDids, aDid, envId, JSON.stringify(initResp), jobDuration.toString(), token, JSON.stringify(res), amount.toString()]);
246+
const args = [null, dsDids, aDid, envId, JSON.stringify(initResp), jobDuration.toString(), token, JSON.stringify(res)]
247+
if (amount) args.push(amount.toString())
248+
await commands.computeStart(args);
247249
});
248250

249251
// startFreeCompute command

0 commit comments

Comments
 (0)