Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@
THEMEDIRECTORY=$(cd `dirname $0` && cd .. && pwd)
FIREFOXFOLDER=~/.mozilla/firefox/
PROFILENAME=""
GNOMISHEXTRAS=false
GNOMISHEXTRAS=true

# Get options.
while getopts 'f:p:g' flag; do
case "${flag}" in
case "${flag}" in
f) FIREFOXFOLDER="${OPTARG}" ;;
p) PROFILENAME="${OPTARG}" ;;
g) GNOMISHEXTRAS=true ;;
esac
done

# Define profile folder path.
if test -z "$PROFILENAME"
if test -z "$PROFILENAME"
then
PROFILEFOLDER="$FIREFOXFOLDER/*.default"
PROFILEFOLDER="$FIREFOXFOLDER/*.default-release-*"
else
PROFILEFOLDER="$FIREFOXFOLDER/$PROFILENAME"
fi
Expand All @@ -27,12 +27,15 @@ cd $PROFILEFOLDER
echo "Installing theme in $PWD"

# Create a chrome directory if it doesn't exist.
echo "Removing old theme"
[[ -d chrome ]] && rm -rf chrome
echo "Creating new directory"
mkdir -p chrome
cd chrome

# Copy theme repo inside
echo "Coping repo in $PWD"
cp -R $THEMEDIRECTORY $PWD
cp -rf $THEMEDIRECTORY $PWD

# Create single-line user CSS files if non-existent or empty.
[[ -s userChrome.css ]] || echo >> userChrome.css
Expand All @@ -50,6 +53,6 @@ fi

# Symlink user.js to firefox-sweet-theme one.
echo "Set configuration user.js file"
ln -s chrome/firefox-sweet-theme/configuration/user.js ../user.js
ln -srf firefox-sweet-theme/configuration/user.js ../user.js

echo "Done."