@multiplatform.one/cli 1.0.33 → 1.0.35
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/lib/bin/multiplatformOne.mjs +36 -22
- package/package.json +2 -2
- package/scripts/cookiecutter.sh +2 -1
- package/src/bin/multiplatformOne.ts +38 -30
|
@@ -7,7 +7,7 @@ import path from "path";
|
|
|
7
7
|
import { execa } from "execa";
|
|
8
8
|
import { fileURLToPath } from "url";
|
|
9
9
|
import { program } from "commander";
|
|
10
|
-
process.env.COOKIECUTTER = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../../scripts/cookiecutter.sh")
|
|
10
|
+
process.env.COOKIECUTTER = `sh ${path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../../scripts/cookiecutter.sh")}`;
|
|
11
11
|
program.name("multiplatform.one");
|
|
12
12
|
program.version(JSON.parse(fsSync.readFileSync(path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../../package.json"), "utf8"))?.version);
|
|
13
13
|
program.command("init").argument("[remote]", "the remote to use", "https://gitlab.com/bitspur/multiplatform.one/cookiecutter").option("--name <name>", "the name of the project").description("init multiplatform.one").action(async (remote) => {
|
|
@@ -29,16 +29,23 @@ program.command("init").argument("[remote]", "the remote to use", "https://gitla
|
|
|
29
29
|
]))?.name
|
|
30
30
|
};
|
|
31
31
|
const cookieCutterConfigFile = path.join(await fs.mkdtemp(path.join(os.tmpdir(), "multiplatform-")), "config.json");
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
32
|
+
try {
|
|
33
|
+
await fs.writeFile(cookieCutterConfigFile, JSON.stringify(cookieCutterConfig, null, 2));
|
|
34
|
+
await execa("sh", [
|
|
35
|
+
path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../../scripts/init.sh"),
|
|
36
|
+
"-f",
|
|
37
|
+
"--config-file",
|
|
38
|
+
cookieCutterConfigFile,
|
|
39
|
+
remote
|
|
40
|
+
], {
|
|
41
|
+
stdio: "inherit"
|
|
42
|
+
});
|
|
43
|
+
} finally {
|
|
44
|
+
await fs.rm(cookieCutterConfigFile, {
|
|
45
|
+
recursive: true,
|
|
46
|
+
force: true
|
|
47
|
+
});
|
|
48
|
+
}
|
|
42
49
|
});
|
|
43
50
|
program.command("update").argument("[remote]", "the remote to use", "https://gitlab.com/bitspur/multiplatform.one/cookiecutter").description("update multiplatform.one").action(async (remote) => {
|
|
44
51
|
if ((await execa("git", [
|
|
@@ -71,16 +78,23 @@ program.command("update").argument("[remote]", "the remote to use", "https://git
|
|
|
71
78
|
}
|
|
72
79
|
if (!cookieCutterConfig) throw new Error("not a multiplatform.one project");
|
|
73
80
|
const cookieCutterConfigFile = path.join(await fs.mkdtemp(path.join(os.tmpdir(), "multiplatform-")), "config.json");
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
81
|
+
try {
|
|
82
|
+
await fs.writeFile(cookieCutterConfigFile, JSON.stringify(cookieCutterConfig, null, 2));
|
|
83
|
+
await execa("sh", [
|
|
84
|
+
path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../../scripts/update.sh"),
|
|
85
|
+
"-f",
|
|
86
|
+
"--config-file",
|
|
87
|
+
cookieCutterConfigFile,
|
|
88
|
+
remote
|
|
89
|
+
], {
|
|
90
|
+
cwd: projectRoot,
|
|
91
|
+
stdio: "inherit"
|
|
92
|
+
});
|
|
93
|
+
} finally {
|
|
94
|
+
await fs.rm(cookieCutterConfigFile, {
|
|
95
|
+
recursive: true,
|
|
96
|
+
force: true
|
|
97
|
+
});
|
|
98
|
+
}
|
|
85
99
|
});
|
|
86
100
|
program.parse(process.argv);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@multiplatform.one/cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.35",
|
|
4
4
|
"author": "BitSpur <support@bitspur.com> (https://bitspur.com)",
|
|
5
5
|
"contributors": [
|
|
6
6
|
{
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"@types/node": "~20.12.13",
|
|
53
53
|
"tsup": "^8.1.0",
|
|
54
54
|
"typescript": "~5.3.3",
|
|
55
|
-
"@multiplatform.one/utils": "^0.0.
|
|
55
|
+
"@multiplatform.one/utils": "^0.0.20"
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
58
|
"commander": "^9.5.0",
|
package/scripts/cookiecutter.sh
CHANGED
|
@@ -29,7 +29,7 @@ import { execa } from 'execa';
|
|
|
29
29
|
import { fileURLToPath } from 'url';
|
|
30
30
|
import { program } from 'commander';
|
|
31
31
|
|
|
32
|
-
process.env.COOKIECUTTER = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../../scripts/cookiecutter.sh')
|
|
32
|
+
process.env.COOKIECUTTER = `sh ${path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../../scripts/cookiecutter.sh')}`;
|
|
33
33
|
program.name('multiplatform.one');
|
|
34
34
|
program.version(
|
|
35
35
|
JSON.parse(
|
|
@@ -60,20 +60,24 @@ program
|
|
|
60
60
|
)?.name,
|
|
61
61
|
};
|
|
62
62
|
const cookieCutterConfigFile = path.join(await fs.mkdtemp(path.join(os.tmpdir(), 'multiplatform-')), 'config.json');
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
63
|
+
try {
|
|
64
|
+
await fs.writeFile(cookieCutterConfigFile, JSON.stringify(cookieCutterConfig, null, 2));
|
|
65
|
+
await execa(
|
|
66
|
+
'sh',
|
|
67
|
+
[
|
|
68
|
+
path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../../scripts/init.sh'),
|
|
69
|
+
'-f',
|
|
70
|
+
'--config-file',
|
|
71
|
+
cookieCutterConfigFile,
|
|
72
|
+
remote,
|
|
73
|
+
],
|
|
74
|
+
{
|
|
75
|
+
stdio: 'inherit',
|
|
76
|
+
},
|
|
77
|
+
);
|
|
78
|
+
} finally {
|
|
79
|
+
await fs.rm(cookieCutterConfigFile, { recursive: true, force: true });
|
|
80
|
+
}
|
|
77
81
|
});
|
|
78
82
|
|
|
79
83
|
program
|
|
@@ -107,21 +111,25 @@ program
|
|
|
107
111
|
}
|
|
108
112
|
if (!cookieCutterConfig) throw new Error('not a multiplatform.one project');
|
|
109
113
|
const cookieCutterConfigFile = path.join(await fs.mkdtemp(path.join(os.tmpdir(), 'multiplatform-')), 'config.json');
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
114
|
+
try {
|
|
115
|
+
await fs.writeFile(cookieCutterConfigFile, JSON.stringify(cookieCutterConfig, null, 2));
|
|
116
|
+
await execa(
|
|
117
|
+
'sh',
|
|
118
|
+
[
|
|
119
|
+
path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../../scripts/update.sh'),
|
|
120
|
+
'-f',
|
|
121
|
+
'--config-file',
|
|
122
|
+
cookieCutterConfigFile,
|
|
123
|
+
remote,
|
|
124
|
+
],
|
|
125
|
+
{
|
|
126
|
+
cwd: projectRoot,
|
|
127
|
+
stdio: 'inherit',
|
|
128
|
+
},
|
|
129
|
+
);
|
|
130
|
+
} finally {
|
|
131
|
+
await fs.rm(cookieCutterConfigFile, { recursive: true, force: true });
|
|
132
|
+
}
|
|
125
133
|
});
|
|
126
134
|
|
|
127
135
|
program.parse(process.argv);
|