jjb-cmd 1.0.15 → 1.0.16
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/package.json +3 -2
- package/src/cli.pull2.js +6 -4
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "jjb-cmd",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.16",
|
4
4
|
"description": "jjb脚手架工具",
|
5
5
|
"main": "index.js",
|
6
6
|
"scripts": {
|
@@ -14,6 +14,7 @@
|
|
14
14
|
"dependencies": {
|
15
15
|
"commander": "1.3.2",
|
16
16
|
"compressing": "^1.5.1",
|
17
|
-
"request": "2.88.2"
|
17
|
+
"request": "2.88.2",
|
18
|
+
"single-line-log": "1.1.2"
|
18
19
|
}
|
19
20
|
}
|
package/src/cli.pull2.js
CHANGED
@@ -16,12 +16,14 @@ const CLOUD_PROJECT = {
|
|
16
16
|
'common': {
|
17
17
|
token: 'G4HJRsHr9D7Ssmixegw2',
|
18
18
|
projectId: 279,
|
19
|
-
localName: 'common'
|
19
|
+
localName: 'common',
|
20
|
+
sha: '20e00c48'
|
20
21
|
},
|
21
22
|
'react-admin-component': {
|
22
23
|
token: 'FT3pKzxpRynFkmddJ9Bs',
|
23
24
|
projectId: 340,
|
24
|
-
localName: 'components'
|
25
|
+
localName: 'components',
|
26
|
+
sha: 'a79d730b'
|
25
27
|
}
|
26
28
|
};
|
27
29
|
// common 需要替换的文本(常规应用)
|
@@ -217,7 +219,7 @@ module.exports = input => {
|
|
217
219
|
utils.DeleteDirAllFile(`${tmpDir}/${GIT_TEMP_DIR}`, () => {
|
218
220
|
fs.mkdirSync(`${tmpDir}/${GIT_TEMP_DIR}`);
|
219
221
|
const stream = fs.createWriteStream(zipPath);
|
220
|
-
request(`${GIT_HOST}/api/v4/projects/${cloudObj.projectId}/repository/archive.zip?private_token=${cloudObj.token}&
|
222
|
+
request(`${GIT_HOST}/api/v4/projects/${cloudObj.projectId}/repository/archive.zip?private_token=${cloudObj.token}&sha=${cloudObj.sha}`)
|
221
223
|
.pipe(stream)
|
222
224
|
.on('close', () => {
|
223
225
|
fs.mkdirSync(zipFolder);
|
@@ -225,7 +227,7 @@ module.exports = input => {
|
|
225
227
|
.then(() => {
|
226
228
|
setTimeout(() => {
|
227
229
|
fs.readdirSync(zipFolder).forEach(dirName => {
|
228
|
-
if (dirName.indexOf(
|
230
|
+
if (dirName.indexOf(`-${cloudObj.sha}`) !== -1) {
|
229
231
|
/* 删除下载的文件 */
|
230
232
|
utils.DeleteDirAllFile(`${srcFolderPath}\\${cloudObj.localName}`, () => {
|
231
233
|
/* 创建临时文件夹 */
|