Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install release tools with npm rather than via pre-commit hook #666

Merged
merged 1 commit into from
Aug 2, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 3 additions & 15 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,19 @@ def minified_file
ENV['FILE'] || 'mustache.min.js'
end

task :install_mocha do
sh "npm install -g mocha" if `which mocha`.empty?
end

task :install_uglify do
sh "npm install -g uglify-js" if `which uglifyjs`.empty?
end

task :install_jshint do
sh "npm install -g jshint" if `which jshint`.empty?
end

desc "Run all tests"
task :test => :install_mocha do
sh "mocha test"
sh "./node_modules/.bin/mocha test"
end

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

desc "Run JSHint"
task :hint => :install_jshint do
sh "jshint mustache.js"
sh "./node_modules/.bin/jshint mustache.js"
end

# Creates a task that uses the various template wrappers to make a wrapped
Expand Down
5 changes: 0 additions & 5 deletions hooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,6 @@ class Bumper
def did_bump
if !@bumped
puts 'bump detected!'
if `which uglifyjs`.empty?
puts_c 31, 'you need uglifyjs installed'
puts 'run `sudo npm install -g uglify-js`'
exit 1
end
end
@bumped = true
end
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@
"devDependencies": {
"chai": "^3.4.0",
"eslint": "^2.5.1",
"jshint": "^2.9.5",
"mocha": "^3.0.2",
"uglify-js": "^3.4.6",
"zuul": "^3.11.0"
},
"spm": {
Expand Down