diff --git a/cmd/sync.ts b/cmd/sync.ts index f45401d..f23d698 100644 --- a/cmd/sync.ts +++ b/cmd/sync.ts @@ -12,7 +12,7 @@ export const registerSyncCommand = (p: Command) => { .command("sync") .action(() => { const getMixFiles = (): { name: string, content: MixFile}[] => { - const files = readdirSync(process.cwd(), { withFileTypes: true }) + const files = readdirSync(isDev ? process.cwd() : homedir(), { withFileTypes: true }) .filter((dirent) => dirent.isFile() && dirent.name.endsWith("mix.hjson") && !dirent.name.startsWith("_")) .map((dirent) => ({ name: dirent.name, @@ -50,7 +50,8 @@ export const registerSyncCommand = (p: Command) => { } const getLockFile = (): MixLockFile => { - return h.parse(readFileSync("mix.lock", "utf-8")); + const mixDir = isDev ? "" : path.join(homedir(), ".mix"); + return h.parse(readFileSync(path.join(mixDir, "mix.lock"), "utf-8")); } const diff = (file: MixFile, lock: MixLockFile) => { diff --git a/index.ts b/index.ts index f704ae7..a55b4b6 100644 --- a/index.ts +++ b/index.ts @@ -6,7 +6,7 @@ const program = new Command(); program .name('mix') .description('a declerative file-based package manager for windows.') - .version('0.0.5', '-v, --version', 'output the current version'); + .version('0.0.6', '-v, --version', 'output the current version'); registerCommands(program); program.parse(); \ No newline at end of file diff --git a/package.json b/package.json index 2c1b556..901c53a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@grng/mix", - "version": "0.0.4", + "version": "0.0.6", "publishConfig": { "access": "public" },