@multiplatform.one/cli 1.0.38 → 1.0.39

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").argument("[name]", "the name of the project", "").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("init multiplatform.one").action(async (name, options) => {
13
+ program.command("init").argument("[name]", "the name of the project", "").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("init multiplatform.one").action(async (name) => {
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
- options.branch,
45
- options.remote
44
+ program.opts().branch,
45
+ program.opts().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 (options) => {
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 () => {
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
- options.branch,
97
- options.remote
96
+ program.opts().branch,
97
+ program.opts().remote
98
98
  ], {
99
99
  cwd: projectRoot,
100
100
  stdio: "inherit"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@multiplatform.one/cli",
3
- "version": "1.0.38",
3
+ "version": "1.0.39",
4
4
  "author": "BitSpur <support@bitspur.com> (https://bitspur.com)",
5
5
  "contributors": [
6
6
  {
@@ -43,7 +43,7 @@ program
43
43
  .option('-r, --remote <remote>', 'the remote to use', 'https://gitlab.com/bitspur/multiplatform.one/cookiecutter')
44
44
  .option('-c, --checkout <branch>', 'branch, tag or commit to checkout', 'main')
45
45
  .description('init multiplatform.one')
46
- .action(async (name, options) => {
46
+ .action(async (name) => {
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
- options.branch,
75
- options.remote,
74
+ program.opts().branch,
75
+ program.opts().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 (options) => {
91
+ .action(async () => {
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
- options.branch,
130
- options.remote,
129
+ program.opts().branch,
130
+ program.opts().remote,
131
131
  ],
132
132
  {
133
133
  cwd: projectRoot,