Skip to content

Instantly share code, notes, and snippets.

@lpil
Last active August 29, 2015 14:05
Show Gist options
  • Save lpil/b3bedc6a5fa6ad6d0d76 to your computer and use it in GitHub Desktop.
Save lpil/b3bedc6a5fa6ad6d0d76 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
# Jekyll sync and rebuild sites in subdirs
path = Dir.pwd
Dir.glob('*/').each do |website_dir|
Dir.chdir path + '/' + website_dir
puts "\e[32m#{Dir.pwd}\e[0m"
output = `git pull`
if result.match(/Already up\-to\-date\./)
puts 'Nothing to change'
next
end
puts output
`git submodule update --init`
puts `jekyll build`
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment