Просмотр исходного кода

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.
tags/v3.2.0
Phillip Johnsen 6 лет назад
Родитель
Сommit
86fa37d39d
2 измененных файлов: 4 добавлений и 9 удалений
  1. +0
    -5
      Rakefile
  2. +4
    -4
      hooks/pre-commit

+ 0
- 5
Rakefile Просмотреть файл

@@ -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"


+ 4
- 4
hooks/pre-commit Просмотреть файл

@@ -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`
@@ -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

Загрузка…
Отмена
Сохранить