From 8458666e2950af10909561841c92b8b9d0614e36 Mon Sep 17 00:00:00 2001 From: Brod8362 <38388134+Brod8362@users.noreply.github.com> Date: Fri, 21 Aug 2020 16:40:06 -0500 Subject: [PATCH] Backup user.js instead of overwriting it (#30) --- README.md | 2 +- install.sh | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 29275a8..92fd4f8 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ + You need `bash` to run it. + If you have an existing chrome folder, the script will make a backup of it in your profile directory. + If the installation script is not working, feel free to submit an issue or a pull request. -+ The script will move a file named `user.js` that contains all the preferences needed for blurredfox to work. If you have a current one, make sure to create a backup. ++ The script will move a file named `user.js` that contains all the preferences needed for blurredfox to work. The existing one will be copied to `user.js.bak`. 1. Run the script below. If you are using a different build like nightly, beta, etc., make sure to replace the 'stable' with the Firefox Build you are using. If leave empty, it will default to stable. diff --git a/install.sh b/install.sh index 30b9d23..08fd2ec 100755 --- a/install.sh +++ b/install.sh @@ -22,6 +22,13 @@ download_bf() { FF_THEME="/tmp/blurredfox-master/" cp -r "${FF_THEME}"* "${CHROME_DIRECTORY}" + # Backup user.js instead of overwriting it + if [ -e "${CHROME_DIRECTORY}/user.js" ] + then + message "[>>] Backing up user.js to user.js.bak..." + cp "${CHROME_DIRECTORY}/user.js" "${CHROME_DIRECTORY}/user.js.bak" + fi + # Move user.js to the main profile directory mv "${CHROME_DIRECTORY}/user.js" "../"