@@ -5,6 +5,8 @@ const constant = require('edam/dist/core/constant').default
5
5
const meow = require ( 'meow' )
6
6
const pkg = require ( '../package.json' )
7
7
const tildify = require ( 'tildify' )
8
+ const get = require ( 'lodash.get' )
9
+ const set = require ( 'lodash.set' )
8
10
const updateNotify = require ( 'update-notifier' )
9
11
const dbg = require ( 'debug' )
10
12
@@ -83,9 +85,16 @@ const flags = [
83
85
name : 'pull.npm-client' ,
84
86
type : 'string' ,
85
87
desc :
86
- 'Appoints to the command when installing package form npmjs.com . [npm|yarn]' ,
88
+ 'Appoints to the command when installing package. [npm|yarn]' ,
87
89
default : 'npm'
88
90
} ,
91
+ {
92
+ name : 'pull.npm-client-args' ,
93
+ type : 'string' ,
94
+ desc :
95
+ 'Appoints to the command\'s arguments when installing package. eg. --pull.npm-client-args="--registry=http://example.com"' ,
96
+ default : ''
97
+ } ,
89
98
{
90
99
name : 'pull.git' ,
91
100
type : 'string' ,
@@ -163,12 +172,13 @@ ${generateFlagHelp(flags, ' ')}
163
172
; ( function ( ) {
164
173
const flags = cli . flags
165
174
// parse array input
166
- ; [ 'extends' , 'plugins' , 'includes' , 'excludes' ] . forEach ( name => {
167
- if ( ! Array . isArray ( flags [ name ] ) && typeof flags [ name ] === 'string' ) {
168
- if ( flags [ name ] ) {
169
- flags [ name ] = flags [ name ] . split ( ',' )
175
+ ; [ 'extends' , 'plugins' , 'includes' , 'excludes' , 'pull.npm-client-args' ] . forEach ( name => {
176
+ const value = get ( flags , name )
177
+ if ( ! Array . isArray ( value ) && typeof value === 'string' ) {
178
+ if ( value ) {
179
+ set ( flags , name , value . split ( ',' ) )
170
180
} else {
171
- flags [ name ] = null
181
+ set ( flags , name , null )
172
182
}
173
183
}
174
184
} )
@@ -194,6 +204,7 @@ ${generateFlagHelp(flags, ' ')}
194
204
plugins : flags . plugins ,
195
205
pull : {
196
206
npmClient : flags . pull [ 'npm-client' ] ,
207
+ npmClientArgs : flags . pull [ 'pull.npm-client-args' ] ,
197
208
git : flags . pull [ 'git' ]
198
209
} ,
199
210
yes : flags . yes ,
0 commit comments