@multiplatform.one/cli 1.0.39 → 1.0.40
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.
|
@@ -10,7 +10,7 @@ import { program } from "commander";
|
|
|
10
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
|
-
program.command("init").
|
|
13
|
+
program.command("init").option("-r, --remote <remote>", "the remote to use", "https://gitlab.com/bitspur/multiplatform.one/cookiecutter").option("-c, --checkout <branch>", "branch, tag or commit to checkout", "main").argument("[name]", "the name of the project", "").description("init multiplatform.one").action(async (name, options) => {
|
|
14
14
|
if ((await execa("git", [
|
|
15
15
|
"rev-parse",
|
|
16
16
|
"--is-inside-work-tree"
|
|
@@ -41,8 +41,8 @@ program.command("init").argument("[name]", "the name of the project", "").option
|
|
|
41
41
|
"--config-file",
|
|
42
42
|
cookieCutterConfigFile,
|
|
43
43
|
"--checkout",
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
options.branch,
|
|
45
|
+
options.remote
|
|
46
46
|
], {
|
|
47
47
|
stdio: "inherit"
|
|
48
48
|
});
|
|
@@ -53,7 +53,7 @@ program.command("init").argument("[name]", "the name of the project", "").option
|
|
|
53
53
|
});
|
|
54
54
|
}
|
|
55
55
|
});
|
|
56
|
-
program.command("update").option("-r, --remote <remote>", "the remote to use", "https://gitlab.com/bitspur/multiplatform.one/cookiecutter").option("-c, --checkout <branch>", "branch, tag or commit to checkout", "main").description("update multiplatform.one").action(async () => {
|
|
56
|
+
program.command("update").option("-r, --remote <remote>", "the remote to use", "https://gitlab.com/bitspur/multiplatform.one/cookiecutter").option("-c, --checkout <branch>", "branch, tag or commit to checkout", "main").description("update multiplatform.one").action(async (options) => {
|
|
57
57
|
if ((await execa("git", [
|
|
58
58
|
"rev-parse",
|
|
59
59
|
"--is-inside-work-tree"
|
|
@@ -93,8 +93,8 @@ program.command("update").option("-r, --remote <remote>", "the remote to use", "
|
|
|
93
93
|
"--config-file",
|
|
94
94
|
cookieCutterConfigFile,
|
|
95
95
|
"--checkout",
|
|
96
|
-
|
|
97
|
-
|
|
96
|
+
options.branch,
|
|
97
|
+
options.remote
|
|
98
98
|
], {
|
|
99
99
|
cwd: projectRoot,
|
|
100
100
|
stdio: "inherit"
|
package/package.json
CHANGED
|
@@ -39,11 +39,11 @@ program.version(
|
|
|
39
39
|
|
|
40
40
|
program
|
|
41
41
|
.command('init')
|
|
42
|
-
.argument('[name]', 'the name of the project', '')
|
|
43
42
|
.option('-r, --remote <remote>', 'the remote to use', 'https://gitlab.com/bitspur/multiplatform.one/cookiecutter')
|
|
44
43
|
.option('-c, --checkout <branch>', 'branch, tag or commit to checkout', 'main')
|
|
44
|
+
.argument('[name]', 'the name of the project', '')
|
|
45
45
|
.description('init multiplatform.one')
|
|
46
|
-
.action(async (name) => {
|
|
46
|
+
.action(async (name, options) => {
|
|
47
47
|
if ((await execa('git', ['rev-parse', '--is-inside-work-tree'], { reject: false })).exitCode === 0) {
|
|
48
48
|
throw new Error('multiplatform.one cannot be initialized inside a git repository');
|
|
49
49
|
}
|
|
@@ -71,8 +71,8 @@ program
|
|
|
71
71
|
'--config-file',
|
|
72
72
|
cookieCutterConfigFile,
|
|
73
73
|
'--checkout',
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
options.branch,
|
|
75
|
+
options.remote,
|
|
76
76
|
],
|
|
77
77
|
{
|
|
78
78
|
stdio: 'inherit',
|
|
@@ -88,7 +88,7 @@ program
|
|
|
88
88
|
.option('-r, --remote <remote>', 'the remote to use', 'https://gitlab.com/bitspur/multiplatform.one/cookiecutter')
|
|
89
89
|
.option('-c, --checkout <branch>', 'branch, tag or commit to checkout', 'main')
|
|
90
90
|
.description('update multiplatform.one')
|
|
91
|
-
.action(async () => {
|
|
91
|
+
.action(async (options) => {
|
|
92
92
|
if ((await execa('git', ['rev-parse', '--is-inside-work-tree'], { reject: false })).exitCode !== 0) {
|
|
93
93
|
throw new Error('multiplatform.one cannot be updated outside of a git repository');
|
|
94
94
|
}
|
|
@@ -126,8 +126,8 @@ program
|
|
|
126
126
|
'--config-file',
|
|
127
127
|
cookieCutterConfigFile,
|
|
128
128
|
'--checkout',
|
|
129
|
-
|
|
130
|
-
|
|
129
|
+
options.branch,
|
|
130
|
+
options.remote,
|
|
131
131
|
],
|
|
132
132
|
{
|
|
133
133
|
cwd: projectRoot,
|