Skip to content

Commit 2e23f7c

Browse files
committed
fix(reload): 修复指定服务地址不生效
1 parent c6d5a5e commit 2e23f7c

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

lib/commands/reload.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ var semver = require('semver');
99
exports.usage = "重载插件";
1010

1111
exports.setOptions = function (optimist) {
12-
optimist.alias('h', 'host');
13-
optimist.describe('h', '拉取插件服务地址');
12+
optimist.alias('s', 'service');
13+
optimist.describe('s', '拉取插件服务地址');
1414
};
1515

1616
exports.run = function (options) {
17-
var host = 'http://' + (options.h || options.host || '192.168.237.71:9999/download');
17+
var servicePath = options.s || options.service || 'http://l-uedmobile0.h.dev.cn0.qunar.com:3000/download';
1818

1919
// 重载全局插件
2020
Manager.reloadRC();
@@ -41,7 +41,7 @@ exports.run = function (options) {
4141
// 下载
4242
var tarName = depName + '@' + version + '.tar.gz';
4343
var extractPath = sysPath.join(process.cwd(), './node_modules/', tarName);
44-
var downloadPath = host + '/' + tarName;
44+
var downloadPath = servicePath + '/' + tarName;
4545
var downloadStream = request(downloadPath).on('response', function (response) {
4646
log('[' + response.statusCode + '] downloading ' + downloadPath);
4747
}).pipe(fs.createWriteStream(extractPath));

src/commands/reload.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ const semver = require('semver')
99
exports.usage = "重载插件"
1010

1111
exports.setOptions = (optimist) => {
12-
optimist.alias('h', 'host')
13-
optimist.describe('h', '拉取插件服务地址')
12+
optimist.alias('s', 'service')
13+
optimist.describe('s', '拉取插件服务地址')
1414
};
1515

1616
exports.run = (options) => {
17-
const host = 'http://' + (options.h || options.host || '192.168.237.71:9999/download')
17+
const servicePath = options.s || options.service || 'http://l-uedmobile0.h.dev.cn0.qunar.com:3000/download'
1818

1919
// 重载全局插件
2020
Manager.reloadRC();
@@ -39,7 +39,7 @@ exports.run = (options) => {
3939
// 下载
4040
const tarName = depName + '@' + version + '.tar.gz'
4141
const extractPath = sysPath.join(process.cwd(), './node_modules/', tarName)
42-
const downloadPath = host + '/' + tarName
42+
const downloadPath = servicePath + '/' + tarName
4343
const downloadStream = request(downloadPath)
4444
.on('response', function(response) {
4545
log(`[${response.statusCode}] downloading ${downloadPath}`)

0 commit comments

Comments
 (0)