Skip to content

Commit 926f90d

Browse files
committed
fixup! fix: spawning of gpg to read config
1 parent 973585c commit 926f90d

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

lib/auth.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { ClientRequest } from 'node:http';
33

44
import ghauth from 'ghauth';
55

6-
import { getMergedConfig, getNcurcPath } from './config.js';
6+
import { clearCachedConfig, getMergedConfig, getNcurcPath } from './config.js';
77

88
export default lazy(auth);
99

@@ -89,6 +89,7 @@ async function auth(
8989
mode: 0o600 /* owner read/write */
9090
});
9191
// Try again reading the file
92+
clearCachedConfig();
9293
({ username, token } = getMergedConfig());
9394
}
9495
check(username, token);

lib/config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ export function getMergedConfig(dir, home) {
2828
}
2929
return mergedConfig;
3030
};
31+
export function clearCachedConfig() {
32+
mergedConfig = null;
33+
}
3134

3235
export function getConfig(configType, dir) {
3336
const configPath = getConfigPath(configType, dir);

0 commit comments

Comments
 (0)