Skip to content

Commit

Permalink
Merge pull request #245 from fukaoi/hotfix/filebase-config-error
Browse files Browse the repository at this point in the history
fix
  • Loading branch information
fukaoi authored Jun 18, 2024
2 parents 8bdf399 + 7fc766e commit 04fb1bb
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/suite-config/src/config-script.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ program
'display debug log on terminal. defalut "false" ',
)
.option(
'-f --filebase <key> <secret>',
'-f --filebase <key> <secret...>',
'Set filebase key and secret. "9CA51CEFF9FF98CB91CF" "CgjYuMvs2NdFGbLPyFDSWESaO05nobQ9mp16PPDo" ',
)
.option(
Expand Down Expand Up @@ -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 => {
Expand Down Expand Up @@ -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);
Expand Down
14 changes: 14 additions & 0 deletions packages/suite-config/test/config-script.test.ts
Original file line number Diff line number Diff line change
@@ -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();
// });

0 comments on commit 04fb1bb

Please sign in to comment.