Skip to content

Commit 86fa37d

Browse files
committed
Bump .version in mustache.js in git hook when version has changed
This changes the pre-commit hook that we've used for years to keep the version value found in `package.json` in sync with the one in `mustache.js`, to change `mustache.mjs` instead since that's where the source code lives now.
1 parent e0a3631 commit 86fa37d

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

Rakefile

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@ task :test do
1212
sh "./node_modules/.bin/mocha test"
1313
end
1414

15-
desc "Make a compressed build in #{minified_file}"
16-
task :minify do
17-
sh "./node_modules/.bin/uglifyjs mustache.js > #{minified_file}"
18-
end
19-
2015
desc "Run JSHint"
2116
task :hint do
2217
sh "./node_modules/.bin/jshint mustache.js"

hooks/pre-commit

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ class Bumper
3434
# if bumped, do extra stuff and notify the user
3535
if @bumped
3636

37-
# minify `mustache.js` using the Rakefile task
38-
puts "> minifying `mustache.js`..."
39-
`rake minify`
37+
# keep .mjs & .js|.min.js in sync
38+
puts "> building and minifying `mustache.mjs`..."
39+
`npm run build`
4040

4141
# stage files for commit
4242
`git add package.json`
@@ -78,7 +78,7 @@ class Bumper
7878
end
7979

8080
bumper = Bumper.new([
81-
Source.new('mustache.js', /mustache.version = '([\d\.]*)'/),
81+
Source.new('mustache.mjs', /version: '([\d\.]*)'/),
8282
Source.new('mustache.js.nuspec', /<version>([\d\.]*)<\/version>/),
8383
])
8484
bumper.start

0 commit comments

Comments
 (0)