File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 38
38
"scripts" : {
39
39
"commitmsg" : " validate-commit-msg" ,
40
40
"precommit" : " gulp prod" ,
41
- "postcommit" : " semantic-release pre --verifyRelease='./src/scripts/npm/nodeVersion '" ,
41
+ "postcommit" : " semantic-release pre --verifyRelease='./src/scripts/npm/updateNpmVersion '" ,
42
42
"prerelease" : " gulp prod" ,
43
43
"semantic-release" : " semantic-release pre && npm publish && semantic-release post"
44
44
},
59
59
"validate-commit-msg" : " ^2.8.2" ,
60
60
"xml2js" : " ^0.4.17"
61
61
}
62
- }
62
+ }
Original file line number Diff line number Diff line change 5
5
var exec = require ( 'child_process' ) . exec
6
6
var fileHelper = require ( '../lib/fileHelper.js' )
7
7
var FILES = [ 'package.json' , 'plugin.xml' , 'plugin.template.xml' ]
8
+ var isChange = false
8
9
9
10
// entry
10
11
module . exports = updateNpmVersion
21
22
var content = readContent ( file )
22
23
var updated = updateVersion ( file , content , version )
23
24
24
- // early exit (made no changes)
25
- if ( content === updated ) return
26
-
27
25
// save
28
26
git += 'git add ' + file + ' && '
29
27
saveContent ( file , updated )
30
28
}
31
- commitChanges ( git , version )
29
+ // publish
30
+ isChange && commitChanges ( git , version )
32
31
}
33
32
34
33
// handle content
53
52
if ( isFileXml ( file ) ) {
54
53
content = content . replace ( prev , next )
55
54
} else {
55
+ isChange = content . version !== version
56
56
content . version = version
57
57
}
58
58
} catch ( e ) {
You can’t perform that action at this time.
0 commit comments