Skip to content

Commit 6c12137

Browse files
committed
fix(cli): fix default config file ENONET error
1 parent 5602309 commit 6c12137

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

packages/cli/src/commander.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,9 @@ describe('logout', () => {
189189

190190
await expect(readFile(configFile, { encoding: 'utf8' })).resolves.not.toContain('my-api-key');
191191

192-
expect(consoleLogSpy).toBeCalledWith(`API token removed from ${configFile}`);
192+
expect(consoleLogSpy).toBeCalledWith(
193+
`API token for ${mockedMCUser.emailAddress} removed from ${configFile}`,
194+
);
193195
});
194196
});
195197

packages/cli/src/commander.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,11 @@ async function createClient(options: CommonOptions, config?: Config) {
3737
options['config'] === defaultConfigPath()
3838
) {
3939
config = {};
40+
} else {
41+
throw new InvalidArgumentError(
42+
`Failed to load config file ${options['config']} due to: ${error}`,
43+
);
4044
}
41-
throw new InvalidArgumentError(
42-
`Failed to load config file ${options['config']} due to: ${error}`,
43-
);
4445
}
4546
}
4647

0 commit comments

Comments
 (0)