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)
|
- [winget](https://github.com/microsoft/winget-cli)
|
||||||
|
|
||||||
## usage
|
## usage
|
||||||
- `bun i mix -g`, then `mix <command> <args>`
|
- `bun i @grng/mix -g`, then `mix <command> <args>`
|
||||||
- OR `bunx mix <command> <args>`
|
- OR `bunx @grng/mix <command> <args>`
|
||||||
- `mix init` to create your mixfile & lock file
|
- `mix init` to create your mixfile & lock file
|
||||||
- `mix sync` to install/remove/update/config packages
|
- `mix sync` to install/remove/update/config packages
|
|
@ -1,5 +1,5 @@
|
||||||
import type { Command } from "commander";
|
import type { Command } from "commander";
|
||||||
import { readdirSync, writeFileSync } from "fs";
|
import { existsSync, mkdirSync, readdirSync, writeFileSync } from "fs";
|
||||||
import * as h from "hjson";
|
import * as h from "hjson";
|
||||||
import { homedir } from "os";
|
import { homedir } from "os";
|
||||||
import path from "path";
|
import path from "path";
|
||||||
|
@ -16,8 +16,11 @@ export const registerInitCommand = (p: Command) => {
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// userhomedir/.mix/mix.hjson
|
|
||||||
const mixDir = isDev ? "" : path.join(homedir(), ".mix");
|
const mixDir = isDev ? "" : path.join(homedir(), ".mix");
|
||||||
|
if (mixDir && !existsSync(mixDir)) {
|
||||||
|
mkdirSync(mixDir, { recursive: true });
|
||||||
|
}
|
||||||
|
|
||||||
writeFileSync(path.join(mixDir, "mix.hjson"), h.stringify({
|
writeFileSync(path.join(mixDir, "mix.hjson"), h.stringify({
|
||||||
default: {
|
default: {
|
||||||
packages: []
|
packages: []
|
||||||
|
|
2
index.ts
2
index.ts
|
@ -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.4', '-v, --version', 'output the current version');
|
.version('0.0.5', '-v, --version', 'output the current version');
|
||||||
|
|
||||||
registerCommands(program);
|
registerCommands(program);
|
||||||
program.parse();
|
program.parse();
|
Loading…
Add table
Add a link
Reference in a new issue