zmp-cli 3.15.3 → 3.15.4
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/deploy/index.js +15 -6
- package/package.json +1 -1
package/deploy/index.js
CHANGED
|
@@ -44,10 +44,17 @@ module.exports = async (
|
|
|
44
44
|
const packageJsonFilename = config.filename.packageJson;
|
|
45
45
|
|
|
46
46
|
let appConfigJson;
|
|
47
|
+
let writeAppConfig = true;
|
|
47
48
|
try {
|
|
48
49
|
appConfigJson = require(resolvePath(appConfigFilename));
|
|
49
50
|
} catch (err) {
|
|
50
|
-
|
|
51
|
+
try {
|
|
52
|
+
// If app-config.json not found, try to use the one in the outputDir
|
|
53
|
+
appConfigJson = require(resolvePath(`${outputDir}/${appConfigFilename}`));
|
|
54
|
+
writeAppConfig = false;
|
|
55
|
+
} catch (err) {
|
|
56
|
+
errorExit(new Error(config.error_msg.app_config_not_found));
|
|
57
|
+
}
|
|
51
58
|
}
|
|
52
59
|
|
|
53
60
|
let packageJson;
|
|
@@ -94,14 +101,16 @@ module.exports = async (
|
|
|
94
101
|
if (flag === 0) {
|
|
95
102
|
errorExit(
|
|
96
103
|
new Error(
|
|
97
|
-
'Please define your assets output at app-config.json. Read more: https
|
|
104
|
+
'Please define your assets output at app-config.json. Read more: https://mini.zalo.me/intro/getting-started/app-config/'
|
|
98
105
|
)
|
|
99
106
|
);
|
|
100
107
|
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
108
|
+
if (writeAppConfig) {
|
|
109
|
+
fse.writeFileSync(
|
|
110
|
+
resolvePath(`${outputDir}/${config.filename.appConfig}`),
|
|
111
|
+
JSON.stringify(appConfigJson)
|
|
112
|
+
);
|
|
113
|
+
}
|
|
105
114
|
} else {
|
|
106
115
|
appConfigJson = await buildApp(
|
|
107
116
|
{ ...options, appConfigJson, nextVersion },
|