From f4cf45247c6b31dc2217500fc808b87b6f6bcb73 Mon Sep 17 00:00:00 2001 From: Austen Adler Date: Thu, 26 May 2016 02:03:21 -0400 Subject: [PATCH] Fix README.md mac/linux installation instructions - Replaced git clone with wget/curl - Checked to make sure wget/curl exist before downloading --- README.md | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 34adae9..6ec0ea7 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,17 @@ A sane default Firefox profile ### Mac ```bash NAME=$RANDOM -git clone https://austenwares.com/gogs/stonewareslord/firefox-link "$HOME/Library/Application Support/Firefox/Profiles/$NAME" +if command -v wget 2>&1 >/dev/null; then + wget https://austenwares.com/gogs/stonewareslord/firefox-link/archive/master.tar.gz -O /tmp/firefox-link.tar.gz +elif command -v curl 2>&1 >/dev/null; then + curl https://austenwares.com/gogs/stonewareslord/firefox-link/archive/master.tar.gz -o /tmp/firefox-link.tar.gz +else + echo "Can't find curl or wget" + return 2 +fi +mkdir -p "$HOME/Library/Application Support/Firefox/Profiles/$NAME" +cd "$HOME/Library/Application Support/Firefox/Profiles/$NAME" +tar xvf /tmp/firefox-link.tar.gz egrep -q '\[Profile\d+\]' "$HOME/Library/Application Support/Firefox/profiles.ini" if (( $? == 0 )); then printf "\n[Profile$(expr 1 + $(cat "$HOME/Library/Application Support/Firefox/profiles.ini" | egrep '\[Profile\d+\]' | tail -n1 | sed -e 's/\[Profile//' -e 's/\]//'))]\nName=firefox-link\nIsRelative=1\nPath=Profiles/$NAME">>"$HOME/Library/Application Support/Firefox/profiles.ini" @@ -20,11 +30,20 @@ else fi '/Applications/Firefox.app/Contents/MacOS/firefox' -p ``` - ### Linux ```bash NAME=$RANDOM -git clone https://austenwares.com/gogs/stonewareslord/firefox-link ~/.mozilla/firefox/$NAME +if command -v wget 2>&1 >/dev/null; then + wget https://austenwares.com/gogs/stonewareslord/firefox-link/archive/master.tar.gz -O /tmp/firefox-link.tar.gz +elif command -v curl 2>&1 >/dev/null; then + curl https://austenwares.com/gogs/stonewareslord/firefox-link/archive/master.tar.gz -o /tmp/firefox-link.tar.gz +else + echo "Can't find curl or wget" + return 2 +fi +mkdir -p ~/.mozilla/firefox/$NAME +cd ~/.mozilla/firefox/$NAME +tar xvf /tmp/firefox-link.tar.gz grep -qP '\[Profile\d+\]' ~/.mozilla/firefox/profiles.ini 2>&1 >/dev/null if (( $? == 0 )); then printf "\n[Profile$(expr 1 + $(cat ~/.mozilla/firefox/profiles.ini | grep -P '\[Profile\d+\]' ~/.mozilla/firefox/profiles.ini | tail -n1 | sed -e 's/\[Profile//' -e 's/\]//'))]\nName=firefox-link\nIsRelative=1\nPath=$NAME">>~/.mozilla/firefox/profiles.ini