Skip to content

Commit

Permalink
fix: config dir resolution (#67)
Browse files Browse the repository at this point in the history
  • Loading branch information
duskpoet committed Jul 12, 2023
1 parent f48b9ad commit 1dcddf9
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@ import yargs from 'yargs';
import { isCi } from './env.js';

export const defaultDir = join(
homedir(),
process.env.XDG_CONFIG_HOME || '.config',
process.env.XDG_CONFIG_HOME || join(homedir(), '.config'),
'neonctl'
);

export const ensureConfigDir = async ({
'config-dir': configDir,
}: yargs.Arguments<{ 'config-dir': string }>) => {
if (!existsSync(configDir) && !isCi()) {
mkdirSync(configDir);
mkdirSync(configDir, { recursive: true });
}
};

0 comments on commit 1dcddf9

Please sign in to comment.