This commit is contained in:
grngxd 2025-06-24 16:10:50 +01:00
parent 52128e9de0
commit 4d1470de56
2 changed files with 7 additions and 4 deletions

View file

@ -1,5 +1,5 @@
import type { Command } from "commander";
import { readdirSync, writeFileSync } from "fs";
import { existsSync, mkdirSync, readdirSync, writeFileSync } from "fs";
import * as h from "hjson";
import { homedir } from "os";
import path from "path";
@ -16,8 +16,11 @@ export const registerInitCommand = (p: Command) => {
process.exit(1);
}
// userhomedir/.mix/mix.hjson
const mixDir = isDev ? "" : path.join(homedir(), ".mix");
if (mixDir && !existsSync(mixDir)) {
mkdirSync(mixDir, { recursive: true });
}
writeFileSync(path.join(mixDir, "mix.hjson"), h.stringify({
default: {
packages: []

View file

@ -6,7 +6,7 @@ const program = new Command();
program
.name('mix')
.description('a declerative file-based package manager for windows.')
.version('0.0.4', '-v, --version', 'output the current version');
.version('0.0.5', '-v, --version', 'output the current version');
registerCommands(program);
program.parse();