@taole/deploy-helper 0.7.3 → 0.7.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/index.mjs +12 -6
- package/lib/offlinePkg.mjs +8 -8
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -383,9 +383,12 @@ async function main() {
|
|
|
383
383
|
log(`entry: ${srcPath}是目录,不支持entry为目录的部署`);
|
|
384
384
|
return;
|
|
385
385
|
}
|
|
386
|
-
const
|
|
387
|
-
|
|
388
|
-
|
|
386
|
+
const dests = Array.isArray(dest) ? dest : [dest];
|
|
387
|
+
for (const dest of dests) {
|
|
388
|
+
const destPath = join(entryDest, dest);
|
|
389
|
+
fs.copyFileSync(srcPath, destPath);
|
|
390
|
+
log(`entry copy: ${srcPath} -> ${destPath}`);
|
|
391
|
+
}
|
|
389
392
|
}
|
|
390
393
|
// log(`entry copy done.`);
|
|
391
394
|
}
|
|
@@ -451,9 +454,12 @@ async function main() {
|
|
|
451
454
|
const scpClient = await getScpClient();
|
|
452
455
|
for (const [src, dest] of Object.entries(syncTestFiles)) {
|
|
453
456
|
const srcPath = join(workDir, src);
|
|
454
|
-
const
|
|
455
|
-
|
|
456
|
-
|
|
457
|
+
const dests = Array.isArray(dest) ? dest : [dest];
|
|
458
|
+
for (const dest of dests) {
|
|
459
|
+
const destPath = "/home/web/website/tuwan_www/templets/static/play/" + dest;
|
|
460
|
+
log(`scp: ${srcPath} -> ${TEST_SERVER_HOST}:${destPath}`);
|
|
461
|
+
await scpClient.uploadFile(srcPath, destPath)
|
|
462
|
+
}
|
|
457
463
|
}
|
|
458
464
|
}
|
|
459
465
|
} catch (error) {
|
package/lib/offlinePkg.mjs
CHANGED
|
@@ -207,14 +207,6 @@ export function checkOfflinePkg(config) {
|
|
|
207
207
|
canBuildOfflinePkg = false;
|
|
208
208
|
}
|
|
209
209
|
}
|
|
210
|
-
let ossToken = "";
|
|
211
|
-
if (canBuildOfflinePkg) {
|
|
212
|
-
ossToken = getOssToken();
|
|
213
|
-
if (!ossToken) {
|
|
214
|
-
errorMsg = "获取ossToken失败";
|
|
215
|
-
canBuildOfflinePkg = false;
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
210
|
if (willSkip) {
|
|
219
211
|
if (!offlineConfig) {
|
|
220
212
|
return {
|
|
@@ -235,6 +227,14 @@ export function checkOfflinePkg(config) {
|
|
|
235
227
|
}
|
|
236
228
|
}
|
|
237
229
|
}
|
|
230
|
+
let ossToken = "";
|
|
231
|
+
if (canBuildOfflinePkg) {
|
|
232
|
+
ossToken = getOssToken();
|
|
233
|
+
if (!ossToken) {
|
|
234
|
+
errorMsg = "获取ossToken失败";
|
|
235
|
+
canBuildOfflinePkg = false;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
238
|
if (!canBuildOfflinePkg) {
|
|
239
239
|
return {
|
|
240
240
|
canBuild: false,
|