Skip to content

Commit 4e5ba87

Browse files
committed
fix(jitsu-cli): make sure ~/.jitsu created before the first login
1 parent f4fe65c commit 4e5ba87

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cli/jitsu-cli/src/commands/login.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ export async function logout({ force }: { force?: boolean }) {
3535
}
3636

3737
export async function login({ host, apikey, force }: { host: string; apikey?: string; force?: boolean }) {
38-
const jitsuFile = `${homedir()}/.jitsu/jitsu-cli.json`;
38+
const jitsuDir = `${homedir()}/.jitsu`;
39+
fs.mkdirSync(jitsuDir, { recursive: true });
40+
const jitsuFile = `${jitsuDir}/jitsu-cli.json`;
3941
if (fs.existsSync(jitsuFile) && !force) {
4042
const loginInfo = JSON.parse(readFileSync(jitsuFile, { encoding: "utf-8" }));
4143
console.error(

0 commit comments

Comments
 (0)