Skip to content
Browse files

refactoring bash_profile changes from Sharethrough, moving rvm bash_p…

…rofile_include outside the marker file block.
  • Loading branch information...
1 parent e3210a4 commit 10c5bf44bbe64f8c8d3d0bbf4c9827ed193644f7 Brian Cunnie & Matthew Kocher committed Sep 15, 2011
View
2 recipes/bash_profile.rb
@@ -1,5 +1,5 @@
::BASH_INCLUDES_DIRNAME = ".bash_profile_includes"
-::BASH_INCLUDES_SUBDIR = File.expand_path("#{WS_HOME}/.#{BASH_INCLUDES_DIRNAME}")
+::BASH_INCLUDES_SUBDIR = File.expand_path("#{WS_HOME}/#{BASH_INCLUDES_DIRNAME}")
directory BASH_INCLUDES_SUBDIR do
owner WS_USER
View
17 recipes/git_scripts.rb
@@ -1,15 +1,14 @@
include_recipe "pivotal_workstation::user_owns_usr_local"
-if(`which git-pair`.empty?)
- execute "put git-scripts in /usr/local/bin" do
- command "cd /usr/local/bin && curl -L http://github.com/pivotal/git_scripts/tarball/master | gunzip | tar xvf - --strip=2"
- user WS_USER
- end
+execute "put git-scripts in /usr/local/bin" do
+ command "cd /usr/local/bin && curl -L http://github.com/pivotal/git_scripts/tarball/master | gunzip | tar xvf - --strip=2"
+ user WS_USER
+ not_if "which git-pair"
+end
- template "#{WS_HOME}/.pairs" do
- owner WS_USER
- source "git_scripts_pairs.erb"
- end
+template "#{WS_HOME}/.pairs" do
+ owner WS_USER
+ source "git_scripts_pairs.erb"
end
ruby_block "test that git pair works" do
View
8 recipes/rvm.rb
@@ -7,6 +7,8 @@
::RVM_HOME = "#{WS_HOME}/.rvm"
::RVM_COMMAND = "#{::RVM_HOME}/bin/rvm"
+bash_profile_include("rvm")
+
run_unless_marker_file_exists(marker_version_string_for("rvm")) do
recursive_directories [RVM_HOME, 'src', 'rvm'] do
owner WS_USER
@@ -24,17 +26,11 @@
user WS_USER
end
- bash_profile_include("rvm")
-
execute "check rvm" do
command "#{RVM_COMMAND} --version | grep Wayne"
user WS_USER
end
- execute "HACK the rvm openssl install script. ./Configure was failing with 'target already defined'. we've filed a bug about this" do
- command "perl -pi -e 's/os\\/compiler darwin/darwin/g' #{::RVM_HOME}/scripts/package"
- end
-
%w{readline autoconf openssl zlib}.each do |rvm_package|
execute "install rvm package: #{rvm_package}" do
command "#{::RVM_COMMAND} package install #{rvm_package}"
View
6 templates/default/bash_profile.erb
@@ -1,6 +1,6 @@
# Chef assumes that it owns this file.
-# Additions to bash should be placed into ~/<%= BASH_INCLUDES_DIRNAME %>/ with a .sh extension
+# Additions to bash should be placed into <%= BASH_INCLUDES_SUBDIR %> with a .sh extension
-for file in $(\ls -1 ${HOME}/<%= BASH_INCLUDES_DIRNAME %>/*.sh 2>/dev/null); do
- source $file;
+for file in ~/<%= BASH_INCLUDES_DIRNAME %>/*.sh; do
+ [[ -r $file ]] && source $file;
done
View
2 templates/default/git_scripts_pairs.erb
@@ -1,3 +1,5 @@
+# This file is managed by chef! Override node.default["git_pairs_authors"] in attributes/git_pairs.rb to modify.
+
pairs:
<% node.git_pairs_authors.each do |half_pair| %>
<%= "#{half_pair["initials"]}: #{half_pair["name"]}"%><%= half_pair["shortname"] ? "; #{half_pair["shortname"]}" : "" %>

0 comments on commit 10c5bf4

Please sign in to comment.
Something went wrong with that request. Please try again.