File tree 1 file changed +18
-2
lines changed
1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -75,8 +75,25 @@ module.exports = function(grunt) {
75
75
'publish' ,
76
76
'Perform final checks and publish Bower' ,
77
77
function ( ) {
78
+ var npmVersion = JSON . parse (
79
+ childProcess . execSync ( 'npm version --json' ) . toString ( )
80
+ ) . npm . split ( '.' ) ;
81
+ var npmMajor = parseInt ( npmVersion [ 0 ] , 10 ) ;
82
+ var npmMinor = parseInt ( npmVersion [ 1 ] , 10 ) ;
83
+
78
84
var jsonPackage = require ( './package' ) ;
79
85
86
+ if ( npmMajor !== 3 || npmMinor < 5 ) {
87
+ grunt . log . writeln (
88
+ 'You need to use at [email protected] to publish bower.'
89
+ ) ;
90
+ grunt . log . writeln (
91
+ 'It is because npm 2.x produces too long paths that Windows does not handle and newer npm drops lib/node_modules'
92
+ ) ;
93
+ grunt . log . writeln ( 'Please upgrade it: npm install -g npm@3' ) ;
94
+ process . exit ( 1 ) ;
95
+ }
96
+
80
97
if (
81
98
childProcess
82
99
. execSync ( 'git rev-parse --abbrev-ref HEAD' )
@@ -200,7 +217,6 @@ module.exports = function(grunt) {
200
217
inquirer . prompt ( questions , function ( answers ) {
201
218
if (
202
219
! answers . review ||
203
- ! answers . changelog ||
204
220
! answers . tests ||
205
221
! answers . publish
206
222
) {
@@ -218,7 +234,7 @@ module.exports = function(grunt) {
218
234
'\nAlso, please remember to test published Bower one more time!'
219
235
) ;
220
236
grunt . log . writeln (
221
- '\nYou can promote this bower release with "npm dist-tag add bower@' + jsonPackage . version + ' latest" '
237
+ '\nYou can promote this bower release with "npm dist-tag add bower@' + jsonPackage . version + ' latest'
222
238
) ;
223
239
grunt . log . writeln ( '\nPublishing Bower...' ) ;
224
240
You can’t perform that action at this time.
0 commit comments