Created
October 22, 2013 07:58
-
-
Save clauswitt/7096769 to your computer and use it in GitHub Desktop.
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
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