This repository was archived by the owner on Jan 5, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +35
-6
lines changed
Expand file tree Collapse file tree 3 files changed +35
-6
lines changed Original file line number Diff line number Diff line change 11'use strict' ;
22
33var PATH = require ( 'path' ) ,
4- Q = require ( 'q' ) ;
4+ Q = require ( 'q' ) ,
5+ C = require ( 'cli-color' ) ;
56
67module . exports = require ( 'coa' ) . Cmd ( )
78 . name ( PATH . basename ( process . argv [ 1 ] ) )
@@ -17,11 +18,35 @@ module.exports = require('coa').Cmd()
1718 return p . name + ' ' + p . version ;
1819 } )
1920 . end ( )
21+ . opt ( )
22+ . name ( 'npm-development' )
23+ . title ( 'Pass ' + C . yellow ( '--development' ) + ' option to ' + C . blueBright ( 'npm install' ) + ' (' + C . yellow ( '--production' ) + ' is passed by default)' )
24+ . long ( 'npm-development' )
25+ . flag ( )
26+ . end ( )
27+ . opt ( )
28+ . name ( 'bower-production' )
29+ . title ( 'Pass ' + C . yellow ( '--production' ) + ' option to ' + C . blueBright ( 'bower install' ) + ' (' + C . yellow ( '--development' ) + ' is passed by default)' )
30+ . long ( 'bower-production' )
31+ . flag ( )
32+ . end ( )
33+ . opt ( )
34+ . name ( 'force' )
35+ . title ( 'Pass ' + C . yellow ( '--force' ) + ' option to ' + C . blueBright ( 'bower install' ) )
36+ . long ( 'force' )
37+ . flag ( )
38+ . end ( )
39+ . opt ( )
40+ . name ( 'force-latest' )
41+ . title ( 'Pass ' + C . yellow ( '--force-latest' ) + ' option to ' + C . blueBright ( 'bower install' ) )
42+ . long ( 'force-latest' )
43+ . flag ( )
44+ . end ( )
2045 . completable ( )
21- . act ( function ( ) {
46+ . act ( function ( opts ) {
2247 var defer = Q . defer ( ) ;
2348
24- require ( './install' ) ( )
49+ require ( './install' ) ( null , opts )
2550 . on ( 'error' , defer . reject . bind ( defer ) )
2651 . on ( 'data' , function ( data ) {
2752 process . stdout . write ( data ) ;
Original file line number Diff line number Diff line change @@ -4,11 +4,13 @@ var PATH = require('path'),
44 CP = require ( 'child_process' ) ,
55 B = require ( 'bower' ) ,
66 Q = require ( 'q' ) ,
7+ L = require ( 'lodash' ) ,
78 QFS = require ( 'q-io/fs' ) ,
89 Emitter = require ( 'events' ) . EventEmitter ;
910
1011module . exports = function ( paths , options ) {
11- options = options || { } ;
12+ options = L . extend ( { } , options || { } ) ;
13+ options . production = ! ! options [ 'bower-production' ] ;
1214
1315 var emitter = new Emitter ( ) ;
1416
@@ -28,7 +30,7 @@ module.exports = function(paths, options) {
2830 return packages [ key ] ;
2931 } ) ,
3032 npmBin = process . env . NPM || 'npm' ,
31- npmArgs = [ 'install' , '--production' ] ,
33+ npmArgs = [ 'install' , options [ 'npm-development' ] ? '--development' : '--production' ] ,
3234 promise = Q . resolve ( ) ;
3335
3436 emitter . emit ( 'paths' , paths ) ;
Original file line number Diff line number Diff line change 1919 "dependencies" : {
2020 "q" : " ~0.9.6" ,
2121 "coa" : " ~0.4.0" ,
22- "q-io" : " ~1.9.1"
22+ "q-io" : " ~1.9.1" ,
23+ "lodash" : " ~1.3.1" ,
24+ "cli-color" : " ~0.2.2"
2325 },
2426 "peerDependencies" : {
2527 "bower" : " ~0.10.0"
You can’t perform that action at this time.
0 commit comments