@multiplatform.one/cli 1.0.40 → 1.0.44

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.
@@ -29,7 +29,9 @@ program.command("init").option("-r, --remote <remote>", "the remote to use", "ht
29
29
  ])).name;
30
30
  }
31
31
  const cookieCutterConfig = {
32
- name
32
+ default_context: {
33
+ name
34
+ }
33
35
  };
34
36
  const cookieCutterConfigFile = path.join(await fs.mkdtemp(path.join(os.tmpdir(), "multiplatform-")), "config.json");
35
37
  try {
@@ -41,7 +43,7 @@ program.command("init").option("-r, --remote <remote>", "the remote to use", "ht
41
43
  "--config-file",
42
44
  cookieCutterConfigFile,
43
45
  "--checkout",
44
- options.branch,
46
+ options.checkout,
45
47
  options.remote
46
48
  ], {
47
49
  stdio: "inherit"
@@ -79,7 +81,9 @@ program.command("update").option("-r, --remote <remote>", "the remote to use", "
79
81
  if ((await fs.stat(path.resolve(projectRoot, "package.json"))).isFile() && (await fs.stat(path.resolve(projectRoot, "app/package.json"))).isFile() && JSON.parse(await fs.readFile(path.resolve(projectRoot, "app/package.json"), "utf8"))?.dependencies?.["multiplatform.one"]?.length) {
80
82
  const name = JSON.parse(await fs.readFile(path.resolve(projectRoot, "package.json"), "utf8"))?.name;
81
83
  if (name) cookieCutterConfig = {
82
- name
84
+ default_context: {
85
+ name
86
+ }
83
87
  };
84
88
  }
85
89
  if (!cookieCutterConfig) throw new Error("not a multiplatform.one project");
@@ -93,7 +97,7 @@ program.command("update").option("-r, --remote <remote>", "the remote to use", "
93
97
  "--config-file",
94
98
  cookieCutterConfigFile,
95
99
  "--checkout",
96
- options.branch,
100
+ options.checkout,
97
101
  options.remote
98
102
  ], {
99
103
  cwd: projectRoot,
package/lib/types.d.mts CHANGED
@@ -1,5 +1,7 @@
1
1
  interface CookieCutterConfig {
2
- name: string;
2
+ default_context: {
3
+ name: string;
4
+ };
3
5
  }
4
6
 
5
7
  export type { CookieCutterConfig };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@multiplatform.one/cli",
3
- "version": "1.0.40",
3
+ "version": "1.0.44",
4
4
  "author": "BitSpur <support@bitspur.com> (https://bitspur.com)",
5
5
  "contributors": [
6
6
  {
package/scripts/init.sh CHANGED
@@ -1,3 +1,5 @@
1
1
  #!/bin/sh
2
2
 
3
+ set -e
4
+
3
5
  $COOKIECUTTER "$@"
@@ -58,7 +58,7 @@ program
58
58
  ])
59
59
  ).name;
60
60
  }
61
- const cookieCutterConfig: CookieCutterConfig = { name };
61
+ const cookieCutterConfig: CookieCutterConfig = { default_context: { name } };
62
62
  const cookieCutterConfigFile = path.join(await fs.mkdtemp(path.join(os.tmpdir(), 'multiplatform-')), 'config.json');
63
63
  try {
64
64
  await fs.writeFile(cookieCutterConfigFile, JSON.stringify(cookieCutterConfig, null, 2));
@@ -71,7 +71,7 @@ program
71
71
  '--config-file',
72
72
  cookieCutterConfigFile,
73
73
  '--checkout',
74
- options.branch,
74
+ options.checkout,
75
75
  options.remote,
76
76
  ],
77
77
  {
@@ -111,7 +111,7 @@ program
111
111
  ]?.length
112
112
  ) {
113
113
  const name = JSON.parse(await fs.readFile(path.resolve(projectRoot, 'package.json'), 'utf8'))?.name;
114
- if (name) cookieCutterConfig = { name };
114
+ if (name) cookieCutterConfig = { default_context: { name } };
115
115
  }
116
116
  if (!cookieCutterConfig) throw new Error('not a multiplatform.one project');
117
117
  const cookieCutterConfigFile = path.join(await fs.mkdtemp(path.join(os.tmpdir(), 'multiplatform-')), 'config.json');
@@ -126,7 +126,7 @@ program
126
126
  '--config-file',
127
127
  cookieCutterConfigFile,
128
128
  '--checkout',
129
- options.branch,
129
+ options.checkout,
130
130
  options.remote,
131
131
  ],
132
132
  {
package/src/types.ts CHANGED
@@ -20,5 +20,7 @@
20
20
  */
21
21
 
22
22
  export interface CookieCutterConfig {
23
- name: string;
23
+ default_context: {
24
+ name: string;
25
+ };
24
26
  }