sparrow-ci 1.1.4 → 1.1.5
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/bin/command/index.js +5 -4
- package/package.json +1 -1
package/bin/command/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: wangqi
|
|
3
3
|
* @Date: 2022-08-12 10:20:19
|
|
4
4
|
* @LastEditors: wangqi
|
|
5
|
-
* @LastEditTime:
|
|
5
|
+
* @LastEditTime: 2023-12-14 17:53:42
|
|
6
6
|
* @FilePath: /sparrow-ci/bin/command/index.js
|
|
7
7
|
* @Description: 上传代码
|
|
8
8
|
*/
|
|
@@ -12,6 +12,7 @@ const path = require('path');
|
|
|
12
12
|
const ora = require("ora");
|
|
13
13
|
const chalk = require('chalk');
|
|
14
14
|
const { handleCodeSize, getKeyName } = require('../utils/index');
|
|
15
|
+
const { robotList } = require('../../ci.config');
|
|
15
16
|
|
|
16
17
|
function project(params) {
|
|
17
18
|
const { projectPath, keyPath, appid } = params;
|
|
@@ -28,7 +29,7 @@ function project(params) {
|
|
|
28
29
|
async function uploadCi(params) {
|
|
29
30
|
const spinner = ora(`${chalk.blue('准备上传')}\n`).start();
|
|
30
31
|
spinner.color = 'blue';
|
|
31
|
-
const { version, description, robotNum } = params;
|
|
32
|
+
const { version, description, robotNum = robotList['default'] } = params;
|
|
32
33
|
try {
|
|
33
34
|
const { subPackageInfo } = await ci.upload({
|
|
34
35
|
project: project(params),
|
|
@@ -58,7 +59,7 @@ async function uploadCi(params) {
|
|
|
58
59
|
});
|
|
59
60
|
console.table(handleCodeSize(subPackageInfo));
|
|
60
61
|
} catch(err) {
|
|
61
|
-
spinner.text = `${chalk.red('上传失败')}\n${chalk.yellow(err)}`;
|
|
62
|
+
spinner.text = `${chalk.red('上传失败')}\n${chalk.yellow(JSON.stringify(err))}`;
|
|
62
63
|
spinner.fail();
|
|
63
64
|
}
|
|
64
65
|
}
|
|
@@ -126,7 +127,7 @@ async function previewCi(params) {
|
|
|
126
127
|
scene, // 场景值 1011
|
|
127
128
|
})
|
|
128
129
|
} catch(err) {
|
|
129
|
-
spinner.text = `${chalk.red('生成预览失败')}\n${chalk.yellow(err)}`;
|
|
130
|
+
spinner.text = `${chalk.red('生成预览失败')}\n${chalk.yellow(JSON.stringify(err))}`;
|
|
130
131
|
spinner.fail();
|
|
131
132
|
}
|
|
132
133
|
}
|