File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import { ClientRequest } from 'node:http';
33
44import ghauth from 'ghauth' ;
55
6- import { getMergedConfig , getNcurcPath } from './config.js' ;
6+ import { clearCachedConfig , getMergedConfig , getNcurcPath } from './config.js' ;
77
88export 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 ) ;
Original file line number Diff line number Diff 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
3235export function getConfig ( configType , dir ) {
3336 const configPath = getConfigPath ( configType , dir ) ;
You can’t perform that action at this time.
0 commit comments