@winner-fed/winner-deploy 2.0.9 → 2.0.10
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/README.md +1 -0
- package/package.json +1 -1
- package/src/winner-deploy.js +10 -1
package/README.md
CHANGED
|
@@ -37,6 +37,7 @@ python2 对应 template/1.x
|
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
+
* @param copyFiles {Array<string>} 不包含在 manifest.json 配置的文件,直接拷贝到 see 包里。文件路径是相对于项目根目录的路径+文件名,比如 dist/子包/version.js,那么 copyFiles: ['version.js']
|
|
40
41
|
* @param cb {function} 回调函数,用于处理在组装 see 包后,压缩成 zip 包前可以自定义执行的动作
|
|
41
42
|
*/
|
|
42
43
|
exports.generateSeePackageZip = function generateSeePackageZip({system, type, name, appType, version, configName, templateFunc, variablesFunc}, cb) {
|
package/package.json
CHANGED
package/src/winner-deploy.js
CHANGED
|
@@ -63,6 +63,7 @@ function genManifest (type, name) {
|
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
|
+
* @param copyFiles {Array<string>} 不包含在 manifest.json 配置的文件,直接拷贝到 see 包里。文件路径是相对于项目根目录的路径+文件名,比如 dist/子包/version.js,那么 copyFiles: ['version.js']
|
|
66
67
|
* @param cb {function} 回调函数,用于处理在组装 see 包后,压缩成 zip 包前可以自定义执行的动作
|
|
67
68
|
*/
|
|
68
69
|
exports.generateSeePackageZip = function generateSeePackageZip ({
|
|
@@ -73,7 +74,8 @@ exports.generateSeePackageZip = function generateSeePackageZip ({
|
|
|
73
74
|
version,
|
|
74
75
|
configName,
|
|
75
76
|
templateFunc,
|
|
76
|
-
variablesFunc
|
|
77
|
+
variablesFunc,
|
|
78
|
+
copyFiles
|
|
77
79
|
}, cb) {
|
|
78
80
|
if (!name || !version) {
|
|
79
81
|
throw new Error('应用名称和应用版本不能缺失~')
|
|
@@ -134,6 +136,13 @@ exports.generateSeePackageZip = function generateSeePackageZip ({
|
|
|
134
136
|
manifestJson
|
|
135
137
|
)
|
|
136
138
|
|
|
139
|
+
// 不包含在 manifest.json 配置的文件,直接拷贝到 see 包里
|
|
140
|
+
if (Array.isArray(copyFiles) && copyFiles.length) {
|
|
141
|
+
copyFiles.forEach((file) => {
|
|
142
|
+
fs.copyFileSync(`./dist/${name}/${file}`, `./tmp/source/${name}/${file}`);
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
|
|
137
146
|
// 自定义执行的操作
|
|
138
147
|
typeof cb === 'function' && cb();
|
|
139
148
|
|