@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.
- package/lib/bin/multiplatformOne.mjs +8 -4
- package/lib/types.d.mts +3 -1
- package/package.json +1 -1
- package/scripts/init.sh +2 -0
- package/src/bin/multiplatformOne.ts +4 -4
- package/src/types.ts +3 -1
|
@@ -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
|
-
|
|
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.
|
|
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
|
-
|
|
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.
|
|
100
|
+
options.checkout,
|
|
97
101
|
options.remote
|
|
98
102
|
], {
|
|
99
103
|
cwd: projectRoot,
|
package/lib/types.d.mts
CHANGED
package/package.json
CHANGED
package/scripts/init.sh
CHANGED
|
@@ -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.
|
|
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.
|
|
129
|
+
options.checkout,
|
|
130
130
|
options.remote,
|
|
131
131
|
],
|
|
132
132
|
{
|