From 52128e9de0e666919b3ab233df9d1f9a839ede72 Mon Sep 17 00:00:00 2001 From: grngxd <36968271+grngxd@users.noreply.github.com> Date: Tue, 24 Jun 2025 16:08:48 +0100 Subject: [PATCH 1/2] fix docs commands --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index db5bf78..0fb2d42 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ - [winget](https://github.com/microsoft/winget-cli) ## usage -- `bun i mix -g`, then `mix ` - - OR `bunx mix ` +- `bun i @grng/mix -g`, then `mix ` + - OR `bunx @grng/mix ` - `mix init` to create your mixfile & lock file - `mix sync` to install/remove/update/config packages \ No newline at end of file From 4d1470de5692e573614a5d20f22d868f693c0bc5 Mon Sep 17 00:00:00 2001 From: grngxd <36968271+grngxd@users.noreply.github.com> Date: Tue, 24 Jun 2025 16:10:50 +0100 Subject: [PATCH 2/2] uhhh --- cmd/init.ts | 9 ++++++--- index.ts | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/cmd/init.ts b/cmd/init.ts index 1f410d7..71aad9d 100644 --- a/cmd/init.ts +++ b/cmd/init.ts @@ -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"; @@ -15,9 +15,12 @@ export const registerInitCommand = (p: Command) => { console.error("Error: Mix project already initialized. Please remove existing .mix.hjson or mix.lock files."); 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: [] diff --git a/index.ts b/index.ts index 9ac76c6..f704ae7 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.4', '-v, --version', 'output the current version'); + .version('0.0.5', '-v, --version', 'output the current version'); registerCommands(program); program.parse(); \ No newline at end of file