Skip to content

Commit 9e82621

Browse files
authored
chore: create .apify directory missing in one place (#779)
1 parent d1a57bb commit 9e82621

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/lib/local_state.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { readFileSync, writeFileSync } from 'node:fs';
22

33
import { STATE_FILE_PATH } from './consts.js';
4+
import { ensureApifyDirectory } from './utils.js';
45

56
/**
67
* Returns state object from auth file or empty object.
@@ -20,5 +21,6 @@ export const getLocalState = () => {
2021
*/
2122
export const extendLocalState = (data: Record<string, unknown>) => {
2223
const state = getLocalState();
24+
ensureApifyDirectory(STATE_FILE_PATH());
2325
writeFileSync(STATE_FILE_PATH(), JSON.stringify({ ...state, ...data }, null, '\t'));
2426
};

0 commit comments

Comments
 (0)