esa-cli 0.0.2-beta.6 → 0.0.2-beta.7
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/dist/i18n/locales.json
CHANGED
|
@@ -476,8 +476,8 @@
|
|
|
476
476
|
"zh_CN": "route不合法"
|
|
477
477
|
},
|
|
478
478
|
"install_runtime_explain": {
|
|
479
|
-
"en": "
|
|
480
|
-
"zh_CN": "
|
|
479
|
+
"en": "Our runtime does not yet support this OS. We are temporarily using Deno as the local development runtime, which needs to be installed first.",
|
|
480
|
+
"zh_CN": "我们的Runtime还不支持此操作系统,我们暂时使用Deno作为本地开发runtime,需要先安装。"
|
|
481
481
|
},
|
|
482
482
|
"install_runtime_tip": {
|
|
483
483
|
"en": "🔔 Runtime must be installed to use esa dev. Installing...",
|
|
@@ -917,6 +917,6 @@
|
|
|
917
917
|
},
|
|
918
918
|
"deno_install_success_tips": {
|
|
919
919
|
"en": "Please run ${dev} again",
|
|
920
|
-
"zh_CN": ""
|
|
920
|
+
"zh_CN": "请重新运行 ${dev}"
|
|
921
921
|
}
|
|
922
922
|
}
|
package/dist/utils/download.js
CHANGED
|
@@ -111,43 +111,50 @@ export function downloadRuntimeAndUnzipForWindows() {
|
|
|
111
111
|
const DenoZip = path.join(BinDir, 'deno.zip');
|
|
112
112
|
const Target = 'x86_64-pc-windows-msvc';
|
|
113
113
|
const DownloadUrl = `http://esa-runtime.myalicdn.com/runtime/deno-${Target}.zip`;
|
|
114
|
+
logger.ora.start('Downloading...');
|
|
114
115
|
try {
|
|
115
116
|
yield fs.mkdir(BinDir, { recursive: true });
|
|
116
117
|
}
|
|
117
118
|
catch (error) {
|
|
118
119
|
const err = error;
|
|
120
|
+
logger.ora.fail();
|
|
119
121
|
logger.error(`mkdir error ${BinDir}: ${err.message}`);
|
|
120
122
|
process.exit(1);
|
|
121
123
|
}
|
|
122
124
|
try {
|
|
123
125
|
yield downloadFile(DownloadUrl, DenoZip);
|
|
124
|
-
logger.success(`${t('deno_download_success').d('Download success')}: ${DenoZip}`);
|
|
125
126
|
}
|
|
126
127
|
catch (error) {
|
|
127
128
|
const err = error;
|
|
129
|
+
logger.ora.fail();
|
|
128
130
|
logger.error(`${t('deno_download_failed').d('Download failed')}: ${err.message}`);
|
|
129
131
|
process.exit(1);
|
|
130
132
|
}
|
|
131
133
|
logger.info(`Unzip file to: ${BinDir}`);
|
|
132
134
|
try {
|
|
135
|
+
logger.ora.text = 'Unzip...';
|
|
133
136
|
unzipFile(DenoZip, BinDir);
|
|
134
137
|
}
|
|
135
138
|
catch (error) {
|
|
136
139
|
const err = error;
|
|
140
|
+
logger.ora.fail();
|
|
137
141
|
logger.error(`${t('deno_unzip_failed').d('Unzip failed')}: ${err.message}`);
|
|
138
142
|
process.exit(1);
|
|
139
143
|
}
|
|
140
144
|
try {
|
|
145
|
+
logger.ora.text = 'Deleting temp file...';
|
|
141
146
|
yield fs.unlink(DenoZip);
|
|
147
|
+
logger.ora.succeed('Download success');
|
|
142
148
|
logger.info(`Delete temp file: ${DenoZip}`);
|
|
143
149
|
}
|
|
144
150
|
catch (error) {
|
|
145
151
|
logger.warn(`Delete temp file ${DenoZip} failed: ${error}`);
|
|
146
152
|
}
|
|
147
153
|
try {
|
|
154
|
+
logger.ora.text = 'Adding Bin dir to PATH...';
|
|
148
155
|
const inPath = yield isBinDirInPath(BinDir);
|
|
149
156
|
if (!inPath) {
|
|
150
|
-
logger.info(`${BinDir} not in PATH
|
|
157
|
+
logger.info(`${BinDir} not in PATH`);
|
|
151
158
|
yield addBinDirToPath(BinDir);
|
|
152
159
|
}
|
|
153
160
|
else {
|
|
@@ -156,6 +163,7 @@ export function downloadRuntimeAndUnzipForWindows() {
|
|
|
156
163
|
}
|
|
157
164
|
catch (error) {
|
|
158
165
|
const err = error;
|
|
166
|
+
logger.ora.fail();
|
|
159
167
|
logger.error(`${t('deno_add_path_failed').d('Add BinDir to Path failed')}: ${err.message}`);
|
|
160
168
|
process.exit(1);
|
|
161
169
|
}
|
|
@@ -166,6 +174,7 @@ export function downloadRuntimeAndUnzipForWindows() {
|
|
|
166
174
|
}
|
|
167
175
|
catch (error) {
|
|
168
176
|
const err = error;
|
|
177
|
+
logger.ora.fail();
|
|
169
178
|
logger.error(`Download Error: ${err.message}`);
|
|
170
179
|
process.exit(1);
|
|
171
180
|
}
|
|
@@ -18,7 +18,7 @@ export function preCheckDeno() {
|
|
|
18
18
|
return __awaiter(this, void 0, void 0, function* () {
|
|
19
19
|
const command = yield checkDenoInstalled();
|
|
20
20
|
if (!command) {
|
|
21
|
-
logger.error(t('install_runtime_explain').d('
|
|
21
|
+
logger.error(t('install_runtime_explain').d('Our runtime does not yet support this OS. We are temporarily using Deno as the local development runtime, which needs to be installed first.'));
|
|
22
22
|
yield installDeno();
|
|
23
23
|
return false;
|
|
24
24
|
}
|
|
@@ -46,7 +46,6 @@ export function checkDenoInstalled() {
|
|
|
46
46
|
resolve(res);
|
|
47
47
|
})
|
|
48
48
|
.catch((err) => {
|
|
49
|
-
console.log(err);
|
|
50
49
|
resolve(false);
|
|
51
50
|
});
|
|
52
51
|
});
|