diff --git a/packages/suite-config/src/config-script.ts b/packages/suite-config/src/config-script.ts index 686f26c2..189de4fe 100755 --- a/packages/suite-config/src/config-script.ts +++ b/packages/suite-config/src/config-script.ts @@ -114,7 +114,7 @@ program 'display debug log on terminal. defalut "false" ', ) .option( - '-f --filebase ', + '-f --filebase ', 'Set filebase key and secret. "9CA51CEFF9FF98CB91CF" "CgjYuMvs2NdFGbLPyFDSWESaO05nobQ9mp16PPDo" ', ) .option( @@ -176,12 +176,12 @@ const execDebug = (bool: string): void => { updateDebugConfigFile(bool); }; -const execFilebase = (filebase: Filebase): void => { - if (filebase.key.length < 1 || filebase.secret.length < 1) { +const execFilebase = (filebase: string[]): void => { + if (filebase.length < 2) { warnMessage('Not found filebase key or secret'); process.exit(0); } - updateFilebaseConfigFile(filebase); + updateFilebaseConfigFile({ key: filebase[0], secret: filebase[1] }); }; const execDasApiUrl = (url: string[]): void => { @@ -217,6 +217,7 @@ if (options.cluster) { } else if (options.debug) { execDebug(options.debug); } else if (options.filebase) { + console.log(options); execFilebase(options.filebase); } else if (options.dasApiUrl) { execDasApiUrl(options.dasApiUrl); diff --git a/packages/suite-config/test/config-script.test.ts b/packages/suite-config/test/config-script.test.ts new file mode 100644 index 00000000..a864f728 --- /dev/null +++ b/packages/suite-config/test/config-script.test.ts @@ -0,0 +1,14 @@ +import test from 'ava'; +import { execSync } from 'child_process'; + +test('exec solana-suite-config script', (t) => { + const res = execSync('pnpm tsx ./src/config-script.ts -s'); + t.log(res.toString()); + t.pass(); +}); + +// test('set filebase parameter', (t) => { +// const res = execSync('pnpm tsx ./src/config-script.ts -f key secret'); +// t.log(res.toString()); +// t.pass(); +// });