зеркало из https://github.com/github/licensed.git
add "force" option to setup
This commit is contained in:
Родитель
03eeeafe5b
Коммит
60870f8273
7
Rakefile
7
Rakefile
|
@ -4,12 +4,15 @@ require "rake/testtask"
|
|||
require "rubocop/rake_task"
|
||||
|
||||
desc "Run source setup scripts"
|
||||
task :setup do
|
||||
task :setup, [:arguments] do |task, args|
|
||||
arguments = args[:arguments].to_s.split
|
||||
force = arguments.include?("-f") ? "-f" : ""
|
||||
|
||||
Dir["script/source-setup/*"].each do |script|
|
||||
# green
|
||||
puts "\033[32mRunning #{script}.\e[0m"
|
||||
|
||||
if system(script)
|
||||
if system(script, force)
|
||||
# green
|
||||
puts "\033[32mCompleted #{script}.\e[0m"
|
||||
elsif $?.exitstatus == 127
|
||||
|
|
|
@ -2,4 +2,4 @@
|
|||
|
||||
set -e
|
||||
|
||||
bundle exec rake setup
|
||||
bundle exec rake setup["$@"]
|
||||
|
|
|
@ -9,4 +9,9 @@ fi
|
|||
# setup test fixtures
|
||||
BASE_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
|
||||
cd $BASE_PATH/test/fixtures/bower
|
||||
|
||||
if [ "$1" == "-f" ]; then
|
||||
find . -not -regex "\.*" -and -not -name "bower\.json" -print0 | xargs -0 rm -rf
|
||||
fi
|
||||
|
||||
bower install
|
||||
|
|
|
@ -13,4 +13,8 @@ cd $BASE_PATH/test/fixtures/bundler
|
|||
# unset any pre-existing gemfile when installing test fixtures
|
||||
unset BUNDLE_GEMFILE
|
||||
|
||||
bundle install --path $BASE_PATH/test/fixtures/bundler/vendor/gems
|
||||
if [ "$1" == "-f" ]; then
|
||||
find . -not -regex "\.*" -and -not -name "Gemfile" -print0 | xargs -0 rm -rf
|
||||
fi
|
||||
|
||||
bundle install --path vendor/gems
|
||||
|
|
|
@ -9,4 +9,9 @@ fi
|
|||
# setup test fixtures
|
||||
BASE_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
|
||||
cd $BASE_PATH/test/fixtures/haskell
|
||||
|
||||
if [ "$1" == "-f" ]; then
|
||||
find . -not -regex "\.*" -and -not -name "app\.cabal" -print0 | xargs -0 rm -rf
|
||||
fi
|
||||
|
||||
cabal new-build
|
||||
|
|
|
@ -9,5 +9,11 @@ fi
|
|||
# setup test fixtures
|
||||
BASE_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
|
||||
export GOPATH="$BASE_PATH/test/fixtures/go"
|
||||
cd $BASE_PATH/test/fixtures/go/src/test
|
||||
cd $BASE_PATH/test/fixtures/go
|
||||
|
||||
if [ "$1" == "-f" ]; then
|
||||
find . -not -regex "\.*" -and -not -path "*/src/test*" -and -not -path "*/src" -print0 | xargs -0 rm -rf
|
||||
fi
|
||||
|
||||
cd src/test
|
||||
go get
|
||||
|
|
|
@ -9,4 +9,9 @@ fi
|
|||
# setup test fixtures
|
||||
BASE_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
|
||||
cd $BASE_PATH/test/fixtures/npm
|
||||
|
||||
if [ "$1" == "-f" ]; then
|
||||
find . -not -regex "\.*" -and -not -name "package\.json" -print0 | xargs -0 rm -rf
|
||||
fi
|
||||
|
||||
npm install
|
||||
|
|
Загрузка…
Ссылка в новой задаче