Skip to content

Commit

Permalink
Bump .version in mustache.js in git hook when version has changed
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
phillipj committed Dec 18, 2019
1 parent e0a3631 commit 86fa37d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
5 changes: 0 additions & 5 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ task :test do
sh "./node_modules/.bin/mocha test"
end

desc "Make a compressed build in #{minified_file}"
task :minify do
sh "./node_modules/.bin/uglifyjs mustache.js > #{minified_file}"
end

desc "Run JSHint"
task :hint do
sh "./node_modules/.bin/jshint mustache.js"
Expand Down
8 changes: 4 additions & 4 deletions hooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ class Bumper
# if bumped, do extra stuff and notify the user
if @bumped

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

# stage files for commit
`git add package.json`
Expand Down Expand Up @@ -78,7 +78,7 @@ class Bumper
end

bumper = Bumper.new([
Source.new('mustache.js', /mustache.version = '([\d\.]*)'/),
Source.new('mustache.mjs', /version: '([\d\.]*)'/),
Source.new('mustache.js.nuspec', /<version>([\d\.]*)<\/version>/),
])
bumper.start

0 comments on commit 86fa37d

Please # to comment.