This commit is contained in:
grngxd 2025-06-24 16:23:45 +01:00
parent 4d1470de56
commit 07e50ddc1e
3 changed files with 5 additions and 4 deletions

View file

@ -12,7 +12,7 @@ export const registerSyncCommand = (p: Command) => {
.command("sync") .command("sync")
.action(() => { .action(() => {
const getMixFiles = (): { name: string, content: MixFile}[] => { 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("_")) .filter((dirent) => dirent.isFile() && dirent.name.endsWith("mix.hjson") && !dirent.name.startsWith("_"))
.map((dirent) => ({ .map((dirent) => ({
name: dirent.name, name: dirent.name,
@ -50,7 +50,8 @@ export const registerSyncCommand = (p: Command) => {
} }
const getLockFile = (): MixLockFile => { 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) => { const diff = (file: MixFile, lock: MixLockFile) => {

View file

@ -6,7 +6,7 @@ const program = new Command();
program program
.name('mix') .name('mix')
.description('a declerative file-based package manager for windows.') .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); registerCommands(program);
program.parse(); program.parse();

View file

@ -1,6 +1,6 @@
{ {
"name": "@grng/mix", "name": "@grng/mix",
"version": "0.0.4", "version": "0.0.6",
"publishConfig": { "publishConfig": {
"access": "public" "access": "public"
}, },