@taole/deploy-helper 1.1.6 → 1.1.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/lib/archive.mjs +2 -4
- package/package.json +1 -1
package/lib/archive.mjs
CHANGED
|
@@ -42,7 +42,7 @@ export function genProjectArchiveBuffer(distPath) {
|
|
|
42
42
|
|
|
43
43
|
/**
|
|
44
44
|
* lib 类型 CDN 打包:若 dist 内仅有名为 version 的子目录则原样打包;
|
|
45
|
-
*
|
|
45
|
+
* 否则为 zip 内所有文件加上 version 前缀。
|
|
46
46
|
*/
|
|
47
47
|
export function genLibArchiveBuffer(distPath, version) {
|
|
48
48
|
const subdirs = fs
|
|
@@ -52,10 +52,8 @@ export function genLibArchiveBuffer(distPath, version) {
|
|
|
52
52
|
return archiveToBuffer((archive) => {
|
|
53
53
|
if (subdirs.length === 1 && subdirs[0].name === version) {
|
|
54
54
|
archive.directory(distPath, false);
|
|
55
|
-
} else if (subdirs.length === 0) {
|
|
56
|
-
appendDirToArchive(archive, distPath, version);
|
|
57
55
|
} else {
|
|
58
|
-
archive
|
|
56
|
+
appendDirToArchive(archive, distPath, version);
|
|
59
57
|
}
|
|
60
58
|
});
|
|
61
59
|
}
|