Skip to content
Browse files

Added bootstrap.sh

  • Loading branch information...
1 parent fa4e336 commit 2b7be30111b3528d89ec5e83c10103bb35b07fbf @sporkd committed Jun 17, 2012
Showing with 109 additions and 22 deletions.
  1. +0 −22 bootstrap.rb
  2. +83 −0 bootstrap.sh
  3. +26 −0 env.rb
View
22 bootstrap.rb
@@ -1,22 +0,0 @@
-dep 'bootstrap' do
- requires 'babushka-deps.cloned'
- username.default(shell('whoami'))
-
- if Prompt.confirm("Install xcode commandline tools only?")
- requires 'xcode commandline tools'
- else
- requires 'xcode tools'
- end
-
- requires 'osx prefs'
- requires 'packages'
- requires 'dotfiles'
- requires 'osx applications'
- requires 'benhoskings:zsh'.with(username)
-end
-
-dep 'babushka-deps.cloned' do
- requires 'github has my public key'
- repo 'git@github.com:sporkd/babushka-deps.git'
- destination '~/.babushka/deps'
-end
View
83 bootstrap.sh
@@ -0,0 +1,83 @@
+#!/bin/bash
+echo
+echo "During this installation, you will be prompted for your password a few times."
+echo
+echo "Waiting 10 seconds. Then going."
+sleep 10
+
+echo "We need to make sure you can write to some directories in /usr/local"
+echo "We may need your user account password to invoke sudo to chgrp and chmod /usr/local to 'user:staff 775'"
+echo "If prompted for your password, please enter it."
+echo
+sleep 2
+echo "Checking to make sure you have a /usr/local directory"
+if [ -d /usr/local ]
+then
+ echo "/usr/local exists. Awesome."
+else
+ sleep 1
+ echo "Creating /usr/local."
+ sudo mkdir -p /usr/local
+ sudo chmod g+w /usr/local
+ sudo chgrp staff /usr/local
+fi
+
+echo "Checking permissions in /usr/local/..."
+# Make sure the current user can write to /usr/local/babushka
+if [ -w /usr/local ]
+then
+ echo "/usr/local is writable. Awesome."
+else
+ sleep 1
+ sudo chmod g+w /usr/local
+ sudo chgrp staff /usr/local
+fi
+
+if [ -w /usr/local/bin ]
+then
+ echo "/usr/local/bin is writable. Also Awesome."
+else
+ sleep 1
+ sudo chmod g+w /usr/local
+ sudo chgrp staff /usr/local
+fi
+
+if [ -w /usr/local/babushka ]
+then
+ echo "/usr/local/babushka is writable."
+elif [ -e /usr/local/babushka ]
+then
+ echo "/usr/local/babushka exists, but is not writable by you. Fixing that."
+ sleep 1
+ sudo chgrp staff /usr/local/babushka
+ sudo chmod g+w /usr/local/babushka
+else
+ echo "/usr/local/babushka does not exist. That's OK. We'll create it later."
+fi
+
+sleep 1
+
+echo
+echo "OK. Permissions are good to go. Next we will install Babushka."
+echo
+
+sleep 2
+
+bash -c "`curl babushka.me/up`"
+# babushka git
+
+echo
+echo "Done. Babushka was installed sucessfully!"
+echo
+
+sleep 5
+
+echo
+echo "OK. Ready to configure your environment."
+echo
+
+babushka sporkd:env
+
+echo
+echo "Bootstrap is complete."
+echo
View
26 env.rb
@@ -0,0 +1,26 @@
+dep 'env' do
+ # requires 'babushka-deps.cloned'
+ username.default(shell('whoami'))
+
+ # if Prompt.confirm("Install xcode commandline tools only?")
+ # requires 'xcode commandline tools'
+ # else
+ # requires 'xcode tools'
+ # end
+
+ # requires 'osx prefs'
+ # requires 'packages'
+ # requires 'dotfiles'
+ # requires 'osx applications'
+ # requires 'benhoskings:zsh'.with(username)
+
+ after {
+ log "Done. Your env is ready!"
+ }
+end
+
+dep 'babushka-deps.cloned' do
+ requires 'github has my public key'
+ repo 'git@github.com:sporkd/babushka-deps.git'
+ destination '~/.babushka/deps'
+end

0 comments on commit 2b7be30

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