refactor: Use common script to avoid code duplication#60
refactor: Use common script to avoid code duplication#60ChrisTitusTech merged 2 commits intoChrisTitusTech:mainfrom
Conversation
|
You might not have realized that different scripts have slightly different checkEnv functions. I submitted a PR #32 a few days ago that correctly handled this behavior and even separated checkEnv into smaller functions. You can pull my PR to inspect it by cloning this repo (It's the one that stores the PRs) and pulling the PR git clone https://github.com/ChrisTitusTech/linutil
git fetch origin pull/32/head:pr_32
git switch pr_32alternatively if you have this repo as upstream in your fork's clone , just do git fetch upstream pull/32/head:pr_32
git switch pr_32If you want I can also merge my original changes to the scripts to your fork, which would then automatically be merged here if this gets accepted. |
|
Nice! I think you might need to update your branch to be compatible with the new main now. I realised now that there have been other changes to that file that need to be added aswell. |
ad19ee7 to
d8600e8
Compare
|
That should be all that's needed. No changes are necessary to the fastUpdate function. |
Yup, my bad. |
This proposed change includes creating a macro to concatenate the common script with the specified script. A macro must be used, since macros (including the concat macro) are evaluated before functions.
The shell will be launched through the shebang within the common script, shebangs within other scripts will be disregarded as comments when they reach the interpreter. This wouldn't cause issues with these scripts, but it should be noted in case the arguments to the shell need to be modified in the future.
Closes #28