Skip to content

Install script: Error handling, shellcheck, shellfmt, various minor fixes, prefer rsync over cp.#35

Open
Vertana wants to merge 2 commits into
EliverLara:masterfrom
Vertana:master
Open

Install script: Error handling, shellcheck, shellfmt, various minor fixes, prefer rsync over cp.#35
Vertana wants to merge 2 commits into
EliverLara:masterfrom
Vertana:master

Conversation

@Vertana
Copy link
Copy Markdown

@Vertana Vertana commented Apr 29, 2020

Main motivation for PR: My profile in firefox was something like $HOME/$FIREFOXFOLDER//le545tters.default-654654. Therefore, the detection of *.default in the install script was not working for me.

I fixed this by searching for all profiles containing ".default" and we use the first match we find. I also added more error handling, error messages, and some minor stuff like typo fixes. If someone feeds illegal/non-existing directories to -f or -p, no work is done and we exit early while informing the user. I forced the symlink at the end of the script, so we don't throw errors if symlink already exists. I also ran ShellCheck against the script and fixed everything I caught. Finally, I ran shellfmt on the script.

I also added rsync detection and usage instead of cp if it's on the host. This is to avoid copying in entire git repos into firefox folders where possible.

Main motivation for PR: My profile in firefox was something like $HOME/$FIREFOXFOLDER//le545tters.default-654654. Therefore, the detection of *.default was not working for me.

I fixed this by searching for all profiles containing ".default" and we use the first match we find. I also added more error handling and error messages. If someone feeds illegal/non-existing directories to -f or -p, no work is done and we exit early while informing the user. I forced the symlink at the end of the script, so we don't throw errors if symlink already exists. I also ran shellcheck against the script and fixed everything I caught. Finally, I ran shellfmt on the script.
@Vertana Vertana changed the title Error handling, shellcheck, and shellfmt. Error handling, shellcheck, shellfmt, various minor fixes, prefer rsync over cp. Apr 29, 2020
@Vertana Vertana changed the title Error handling, shellcheck, shellfmt, various minor fixes, prefer rsync over cp. Install script: Error handling, shellcheck, shellfmt, various minor fixes, prefer rsync over cp. Apr 29, 2020
@Vertana
Copy link
Copy Markdown
Author

Vertana commented Apr 29, 2020

I also see now that these changes would also pick up the $PROFILENAME $FIREFOX/*.default-release as mentioned in the commit for #31

Comment thread scripts/install.sh Outdated
Updated for NixOS as requested.
@TheGameFreak720
Copy link
Copy Markdown

I tested this script out since I was running into issues with installing the theme in Firefox, and it works perfectly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants