@tolinax/ayoune-cli 2024.2.3 → 2024.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +16 -34
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,34 +1,16 @@
|
|
|
1
|
-
#! /usr/bin/env node
|
|
2
|
-
import { Command } from "commander";
|
|
3
|
-
import { createSpinner } from "nanospinner";
|
|
4
|
-
import { initializeSettings } from "./lib/helpers/initializeSettings.js";
|
|
5
|
-
import { createProgram } from "./lib/commands/createProgram.js";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
console.log(pkg);
|
|
18
|
-
autoupdater(pkg)
|
|
19
|
-
.then((updated) => {
|
|
20
|
-
if (updated) {
|
|
21
|
-
// The application was updated, so exit
|
|
22
|
-
console.log("You may rerun the last command");
|
|
23
|
-
process.exit();
|
|
24
|
-
}
|
|
25
|
-
else {
|
|
26
|
-
// No update occurred, so just run the application
|
|
27
|
-
createProgram(program);
|
|
28
|
-
}
|
|
29
|
-
})
|
|
30
|
-
.catch((e) => {
|
|
31
|
-
// An error has occurred so
|
|
32
|
-
console.log(e);
|
|
33
|
-
process.exit();
|
|
34
|
-
});
|
|
1
|
+
#! /usr/bin/env node
|
|
2
|
+
import { Command } from "commander";
|
|
3
|
+
import { createSpinner } from "nanospinner";
|
|
4
|
+
import { initializeSettings } from "./lib/helpers/initializeSettings.js";
|
|
5
|
+
import { createProgram } from "./lib/commands/createProgram.js";
|
|
6
|
+
import path from "path";
|
|
7
|
+
import { readFile } from "fs/promises";
|
|
8
|
+
import * as process from "process";
|
|
9
|
+
//Create new command instance
|
|
10
|
+
//@ts-ignore
|
|
11
|
+
const pkg = JSON.parse(await readFile(path.join(process.cwd(), "package.json"), "utf8"));
|
|
12
|
+
const program = new Command();
|
|
13
|
+
initializeSettings();
|
|
14
|
+
//Setup spinner
|
|
15
|
+
export const spinner = createSpinner("Getting data...");
|
|
16
|
+
createProgram(program);
|