Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Vertana
Copy link

@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
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

scripts/install.sh Outdated Show resolved Hide resolved
Updated for NixOS as requested.
@TheGameFreak720
Copy link

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