Skip to content

Commit 2419c37

Browse files
committed
⚡ 逻辑增强.
1 parent e3b1337 commit 2419c37

File tree

5 files changed

+11
-7
lines changed

5 files changed

+11
-7
lines changed

Diff for: .github/CODEOWNERS

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @zyao89

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@micro-app/plugin-deploy-command",
3-
"version": "0.1.0",
3+
"version": "0.1.1",
44
"description": "[Plugin] auto deploy command plugin.",
55
"main": "src/index.js",
66
"scripts": {

Diff for: src/commands/deploy/deployCommit.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const CONSTANTS = require('../../constants');
77

88
function execJS(execStr, options = {}) {
99
return new Promise((resolve, reject) => {
10-
shelljs.exec(execStr, Object.assign({ silent: true, async: true }, options), function(code, stdout, stderr) {
10+
shelljs.exec(execStr, Object.assign({ silent: true, async: true, stdio: 'inherit' }, options), function(code, stdout, stderr) {
1111
if (code && stderr) {
1212
reject(new Error(stderr));
1313
} else {

Diff for: src/commands/deploy/parseConfig.js

+7-4
Original file line numberDiff line numberDiff line change
@@ -83,17 +83,20 @@ module.exports = function(api, args, opts) {
8383
if (_.isEmpty(deployConfig) || !_.isPlainObject(deployConfig)) {
8484
api.logger.warn('没有找到可用的配置文件信息, 将使用默认配置.');
8585
}
86-
deployConfig = Object.assign({}, opts, deployConfig || {});
87-
if (_.isEmpty(deployConfig)) return null;
8886

8987
// parse config
9088
if (Array.isArray(deployConfig)) {
9189
const result = deployConfig.map(item => {
90+
const _config = Object.assign({}, opts, item || {});
91+
if (_.isEmpty(_config)) return null;
9292
return parseConfig(item, api, args);
93-
});
93+
}).filter(item => !!item);
94+
if (_.isEmpty(result)) return null;
9495
return result;
9596
}
9697

97-
const data = parseConfig(deployConfig, api, args);
98+
const _config = Object.assign({}, opts, deployConfig || {});
99+
if (_.isEmpty(_config)) return null;
100+
const data = parseConfig(_config, api, args);
98101
return [ data ];
99102
};

Diff for: src/commands/version/version.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ describe('Command version', () => {
1515
link: path.join(__dirname, './index.js'),
1616
});
1717

18-
const plugin = service.plugins.find(item => item.id === 'cli:plugins-commands-version');
18+
const plugin = service.plugins.find(item => item.id === 'cli:plugin-command-version');
1919
expect(typeof plugin).toEqual('object');
2020

2121
service.init();

0 commit comments

Comments
 (0)