mgc 1.2.1 → 1.2.3
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/bin/generate.js +12 -0
- package/bin/setup.js +1 -1
- package/package.json +3 -3
package/bin/generate.js
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
import path from "path";
|
|
4
|
+
import { fileURLToPath } from "url";
|
|
5
|
+
import { spawnSync } from "child_process";
|
|
4
6
|
import { program } from "commander";
|
|
5
7
|
|
|
6
8
|
import { generateModule } from "../services/filecopy.service.js";
|
|
7
9
|
|
|
10
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
11
|
+
|
|
8
12
|
program
|
|
9
13
|
.command("gen <modulePath>")
|
|
10
14
|
.description("Generate a module project")
|
|
@@ -21,4 +25,12 @@ program
|
|
|
21
25
|
generateModule(modulePath, currentDir);
|
|
22
26
|
});
|
|
23
27
|
|
|
28
|
+
program
|
|
29
|
+
.command("setup")
|
|
30
|
+
.description("Run the MGC setup")
|
|
31
|
+
.action(() => {
|
|
32
|
+
const setupPath = path.join(__dirname, "setup.js");
|
|
33
|
+
spawnSync(process.execPath, [setupPath], { stdio: "inherit" });
|
|
34
|
+
});
|
|
35
|
+
|
|
24
36
|
program.parse(process.argv);
|
package/bin/setup.js
CHANGED
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mgc",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.3",
|
|
4
4
|
"description": "A cli based tool for generating your saved modules",
|
|
5
5
|
"author": "Admond Tamang",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"main": "bin/generate",
|
|
8
8
|
"bin": {
|
|
9
|
-
"
|
|
10
|
-
"mgc": "bin/
|
|
9
|
+
"mgc": "bin/generate.js",
|
|
10
|
+
"mgc-setup": "bin/setup.js"
|
|
11
11
|
},
|
|
12
12
|
"repository": {
|
|
13
13
|
"type": "git",
|