Skip to content

Instantly share code, notes, and snippets.

@foonicorn
Created July 20, 2014 07:05
Show Gist options
  • Save foonicorn/e6696fb8697668427ee0 to your computer and use it in GitHub Desktop.
Save foonicorn/e6696fb8697668427ee0 to your computer and use it in GitHub Desktop.
Install Homebrew without sudo and wget/curl
#!/bin/bash
HOMEBREW_URL="https://github.com/Homebrew/homebrew/archive/master.zip"
HOMEBREW_DOWNLOAD=homebrew-master.zip
HOMWBREW_UNZIPED=homebrew-master
HOMEBREW_DIR="$HOME/Homebrew"
# Use Python to download homebrew because wget and curl may not be installed.
python -c "import urllib2; r=urllib2.urlopen('$HOMEBREW_URL'); f=open('$HOMEBREW_DOWNLOAD','w'); f.write(r.read()); f.close()"
unzip -q $HOMEBREW_DOWNLOAD
mv $HOMWBREW_UNZIPED $HOMEBREW_DIR
rm $HOMEBREW_DOWNLOAD
echo "export PATH=$HOMEBREW_DIR/bin:$HOMEBREW_DIR/sbin:\$PATH" >> $HOME/.profile
echo "Success!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment