Skip to content

Instantly share code, notes, and snippets.

@oosawa
Created September 11, 2019 05:49
Show Gist options
  • Save oosawa/eac3e7145199e8a87ae4efc5379f74fa to your computer and use it in GitHub Desktop.
Save oosawa/eac3e7145199e8a87ae4efc5379f74fa to your computer and use it in GitHub Desktop.
# frozen_string_literal: true
dirs = Dir.glob('*/')
pwd = Dir.pwd
dirs.each do |dir|
# git の管理下にありそうな場合はそこに移動して fetch する
next unless Dir.exist?("#{pwd}/#{dir}.git/")
Dir.chdir "#{pwd}/#{dir}"
system 'git fetch'
puts Dir.pwd
puts 'git fetch'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment