install.sh update

This commit is contained in:
Gerome Matilla 2020-07-08 16:11:11 +08:00
parent 2e25f384b5
commit ff1d243b16

View File

@ -1,6 +1,8 @@
#!/usr/bin/env bash #!/usr/bin/env bash
message() { printf "%s\n" "$*" >&2; } message() {
printf "%s\n" "$*" >&2;
}
download_bf() { download_bf() {
@ -44,18 +46,13 @@ EOF
message "blurredfox successfully installed! To enable the transparency change the theme to Dark in preferences! Enjoy!" message "blurredfox successfully installed! To enable the transparency change the theme to Dark in preferences! Enjoy!"
} }
FF_USER_DIRECTORY="$(find "${HOME}/.mozilla/firefox/" -maxdepth 1 -type d -regextype egrep -regex '.*[a-zA-Z0-9]+.default-(release|default|esr)')"
FF_USER_DIRECTORY="$(find "${HOME}/.mozilla/firefox/" -maxdepth 1 -type d -regextype egrep -regex '.*[a-zA-Z0-9]+.default-(release|default)')"
if [[ -n $FF_USER_DIRECTORY ]]; if [[ -n $FF_USER_DIRECTORY ]];
then then
message "[>>] Firefox user profile directory located..." message "[>>] Firefox user profile directory located..."
CHROME_DIRECTORY="$(find "$FF_USER_DIRECTORY" -maxdepth 1 -type d -name 'chrome')" CHROME_DIRECTORY="$(find "$FF_USER_DIRECTORY" -maxdepth 1 -type d -name 'chrome')"
if [[ -n $CHROME_DIRECTORY ]]; if [[ -n $CHROME_DIRECTORY ]];
then then
# Check if the chrome folder contains files # Check if the chrome folder contains files
shopt -s nullglob dotglob shopt -s nullglob dotglob
content="${CHROME_DIRECTORY}/" content="${CHROME_DIRECTORY}/"
@ -67,11 +64,8 @@ then
mv "${CHROME_DIRECTORY}" "${CHROME_DIRECTORY}.backup" mv "${CHROME_DIRECTORY}" "${CHROME_DIRECTORY}.backup"
mkdir "${CHROME_DIRECTORY}" mkdir "${CHROME_DIRECTORY}"
fi fi
download_bf download_bf
else else
message "[>>] Chrome directory does not exist! Creating one..." message "[>>] Chrome directory does not exist! Creating one..."
mkdir "${FF_USER_DIRECTORY}/chrome" mkdir "${FF_USER_DIRECTORY}/chrome"