Skip to content

Instantly share code, notes, and snippets.

@KitaitiMakoto
Created March 16, 2012 16:37
Show Gist options
  • Save KitaitiMakoto/2050960 to your computer and use it in GitHub Desktop.
Save KitaitiMakoto/2050960 to your computer and use it in GitHub Desktop.
開発用ディレクトリーとチェック用ディレクトリーをすばやく切り替える方法は? ref: http://qiita.com/items/484b7242322c5f4f6e94
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