Compare commits
2 commits
eac55e01c5
...
4d1470de56
Author | SHA1 | Date | |
---|---|---|---|
![]() |
4d1470de56 | ||
![]() |
52128e9de0 |
3 changed files with 9 additions and 6 deletions
|
@ -11,7 +11,7 @@
|
|||
- [winget](https://github.com/microsoft/winget-cli)
|
||||
|
||||
## usage
|
||||
- `bun i mix -g`, then `mix <command> <args>`
|
||||
- OR `bunx mix <command> <args>`
|
||||
- `bun i @grng/mix -g`, then `mix <command> <args>`
|
||||
- OR `bunx @grng/mix <command> <args>`
|
||||
- `mix init` to create your mixfile & lock file
|
||||
- `mix sync` to install/remove/update/config packages
|
|
@ -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: []
|
||||
|
|
2
index.ts
2
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();
|
Loading…
Add table
Add a link
Reference in a new issue