Created
March 16, 2012 16:37
-
-
Save KitaitiMakoto/2050960 to your computer and use it in GitHub Desktop.
開発用ディレクトリーとチェック用ディレクトリーをすばやく切り替える方法は? ref: http://qiita.com/items/484b7242322c5f4f6e94
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
desc 'チェック用リポジトリーのブランチを切り替えます' | |
task :checkrepo, [:branch] do |t, args| | |
if args[:branch].nil? || args[:branch].empty? | |
$stderr.puts 'ブランチ名を指定してください' | |
$stderr.puts '使い方:rake checkrepo[branchname]' | |
exit! | |
end | |
Dir.chdir '../check' do | |
unless system("git checkout #{args[:branch]}") | |
$stderr.puts "ブランチ #{args[:branch]} に切り替えられませんでした" | |
$stderr.puts `git branch` | |
exit! | |
end | |
sh 'git pull' | |
Rake::Task['scss:update'].invoke | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment