@multiplatform.one/cli 1.0.32 → 1.0.34
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 +38 -24
- package/package.json +2 -2
- package/src/bin/multiplatformOne.ts +41 -33
|
@@ -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) => {
|
|
@@ -28,17 +28,24 @@ program.command("init").argument("[remote]", "the remote to use", "https://gitla
|
|
|
28
28
|
}
|
|
29
29
|
]))?.name
|
|
30
30
|
};
|
|
31
|
-
const cookieCutterConfigFile = await fs.mkdtemp(path.join(os.tmpdir(), "multiplatform-"));
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
31
|
+
const cookieCutterConfigFile = path.join(await fs.mkdtemp(path.join(os.tmpdir(), "multiplatform-")), "config.json");
|
|
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", [
|
|
@@ -70,17 +77,24 @@ program.command("update").argument("[remote]", "the remote to use", "https://git
|
|
|
70
77
|
};
|
|
71
78
|
}
|
|
72
79
|
if (!cookieCutterConfig) throw new Error("not a multiplatform.one project");
|
|
73
|
-
const cookieCutterConfigFile = await fs.mkdtemp(path.join(os.tmpdir(), "multiplatform-"));
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
80
|
+
const cookieCutterConfigFile = path.join(await fs.mkdtemp(path.join(os.tmpdir(), "multiplatform-")), "config.json");
|
|
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.34",
|
|
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.19"
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
58
|
"commander": "^9.5.0",
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* File Created: 22-06-2024 14:17:12
|
|
5
5
|
* Author: Clay Risser
|
|
6
6
|
* -----
|
|
7
|
-
* BitSpur
|
|
7
|
+
* BitSpur Copyright 2021 - 2024
|
|
8
8
|
*
|
|
9
9
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
10
10
|
* you may not use this file except in compliance with the License.
|
|
@@ -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(
|
|
@@ -59,21 +59,25 @@ program
|
|
|
59
59
|
])
|
|
60
60
|
)?.name,
|
|
61
61
|
};
|
|
62
|
-
const cookieCutterConfigFile = await fs.mkdtemp(path.join(os.tmpdir(), 'multiplatform-'));
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
62
|
+
const cookieCutterConfigFile = path.join(await fs.mkdtemp(path.join(os.tmpdir(), 'multiplatform-')), 'config.json');
|
|
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
|
|
@@ -106,22 +110,26 @@ program
|
|
|
106
110
|
if (name) cookieCutterConfig = { name };
|
|
107
111
|
}
|
|
108
112
|
if (!cookieCutterConfig) throw new Error('not a multiplatform.one project');
|
|
109
|
-
const cookieCutterConfigFile = await fs.mkdtemp(path.join(os.tmpdir(), 'multiplatform-'));
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
113
|
+
const cookieCutterConfigFile = path.join(await fs.mkdtemp(path.join(os.tmpdir(), 'multiplatform-')), 'config.json');
|
|
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);
|