Install script: Error handling, shellcheck, shellfmt, various minor fixes, prefer rsync over cp.#35
Open
Vertana wants to merge 2 commits into
Open
Install script: Error handling, shellcheck, shellfmt, various minor fixes, prefer rsync over cp.#35Vertana wants to merge 2 commits into
Vertana wants to merge 2 commits into
Conversation
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.
Author
|
I also see now that these changes would also pick up the $PROFILENAME $FIREFOX/*.default-release as mentioned in the commit for #31 |
nova-nowiz
reviewed
Sep 29, 2020
Updated for NixOS as requested.
|
I tested this script out since I was running into issues with installing the theme in Firefox, and it works perfectly |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.