@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 CHANGED
@@ -383,9 +383,12 @@ async function main() {
383
383
  log(`entry: ${srcPath}是目录,不支持entry为目录的部署`);
384
384
  return;
385
385
  }
386
- const destPath = join(entryDest, dest);
387
- fs.copyFileSync(srcPath, destPath);
388
- log(`entry copy: ${srcPath} -> ${destPath}`);
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 destPath = "/home/web/website/tuwan_www/templets/static/play/" + dest;
455
- log(`scp: ${srcPath} -> ${TEST_SERVER_HOST}:${destPath}`);
456
- await scpClient.uploadFile(srcPath, destPath)
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) {
@@ -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,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taole/deploy-helper",
3
- "version": "0.7.3",
3
+ "version": "0.7.4",
4
4
  "description": "脚本部署工具,用于将项目部署到测试环境或生产环境",
5
5
  "main": "index.mjs",
6
6
  "type": "module",