-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcli.js
More file actions
29 lines (25 loc) · 728 Bytes
/
Copy pathcli.js
File metadata and controls
29 lines (25 loc) · 728 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env node
import { program } from "commander";
import ora from "ora";
import { readFileSync } from "fs";
import main from "./index.js";
import logger from "./src/helpers/logger.js";
const pkg = JSON.parse(readFileSync("./package.json", "utf8"));
const spinner = ora("Running...\n");
spinner.color = "green";
program
.option(
"-r, --remove",
"Remove the entire entry from the user level .npmrc file",
false
)
.action((options) => {
logger.success(`Private NPM Setup v${pkg.version}🔥🚀`);
if (options.remove) {
logger.warn("Removing entry from the user level .npmrc only.");
}
spinner.start();
})
.version(pkg.version)
.parse(process.argv);
main(program, spinner);