Skip to content

Instantly share code, notes, and snippets.

@clauswitt
Created October 22, 2013 07:58
Show Gist options
  • Save clauswitt/7096769 to your computer and use it in GitHub Desktop.
Save clauswitt/7096769 to your computer and use it in GitHub Desktop.
include_recipe "git"
search( :users, "dotfiles:*" ).each do |u|
user_id = u["id"]
directory "/home/#{user_id}/bin" do
owner user_id
group user_id
mode "0755"
action :create
end
git "/home/#{user_id}/bin/dotfiles" do
repository u["dotfiles"]
reference "master"
user user_id
group user_id
action :checkout
not_if "test -d /home/#{user_id}/bin/dotfiles"
end
execute "./install.sh" do
cwd "/home/#{user_id}/bin/dotfiles"
command "./install.sh /home/#{user_id}"
end
execute "git submodule init" do
cwd "/home/#{user_id}/bin/dotfiles"
command "git submodule init"
end
execute "git submodule update" do
cwd "/home/#{user_id}/bin/dotfiles"
command "git submodule update"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment