From 6955dc78e317d6bd01975c5c9995eda2c194b5db Mon Sep 17 00:00:00 2001 From: Austen Adler Date: Mon, 23 May 2016 21:57:02 -0400 Subject: [PATCH] Readme changes --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 399d9ce..f96f609 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,12 @@ A sane default firefox profile ```bash NAME=$RANDOM git clone https://austenwares.com/gogs/stonewareslord/firefox-link ~"/Library/Application Support/Firefox/Profiles/$NAME" -printf "\n[Profile$((1+$(cat ~"/Library/Application Support/Firefox/profiles.ini" | ag '\[Profile\d+\]' | tail -n1 | sed -e 's/\[Profile//' -e 's/\]//')))]\nName=firefox-link\nIsRelative=1\nPath=Profiles/$NAME">>~"/Library/Application Support/Firefox/profiles.ini" +egrep -q '\[Profile\d+\]' ~"/Library/Application Support/Firefox/profiles.ini" +if (( $? == 0 )); then + printf "\n[Profile$(expr 1 + $(cat ~"/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">>~"/Library/Application Support/Firefox/profiles.ini" +else + mkdir -p ~"/Library/Application Support/Firefox/" + printf "\n[Profile0]\nName=firefox-link\nIsRelative=1\nPath=Profiles/$NAME">>~"/Library/Application Support/Firefox/profiles.ini" +fi '/Applications/Firefox.app/Contents/MacOS/firefox' -p ```