-
-
Notifications
You must be signed in to change notification settings - Fork 225
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
Add "APPNAME" headings in .env
, and move the "migrate" logic into appvars_create.sh
#1745
Open
CLHatch
wants to merge
76
commits into
GhostWriters:variable-naming
Choose a base branch
from
CLHatch:variable-naming
base: variable-naming
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains 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
Add headings for each app in the .env in the form of: # # APPNAME #
Fix indenting
Remove extra spaces to pass linting
Move `APPNAME` != `LAST_APPNAME` test to avoid issues with global variables.
Remove extra spaces to pass linting again.
Add an extra line after the "Global settings", so there's a blank line before the first application variable comment.
Add `# APPNAME` and `# APPNAME (User Defined)` headings to .env file. Change logic to files into arrays and search the arrays instead of reading line by line.
Remove whitespace on blank line
Use `inArray "element" "array"` to check if an element is in an array (fixes "deluge" matching "delugevpn"). Clear `APP_LABEL_LIST` array when a new app is iterated to the `.env` file.
Fix shellcheck errors.
Fix some shellcheck warnings.
Fix more shellcheck warnings.
Fix shell check warning for `'ls`
Fix `shfmt` errors
Fix `shfmt` error
Fix index variable when unsetting element of an array.
Removes `appvars_migrate.sh` and`appvars_migrate_all.sh`. Migration is done in `appvars_create.sh` if it sees existing variables to be migrated. Tries to handle not migrating from variables such as `<APPNAME>_PORT_####`, `<APPNAME>_RESTART``, etc.
Fix linting errors.
Check to be sure the the potentially migrated variable name isn't an existing label for the app, instead of using a hardcoded list of exclusions.
Fix linting error
CLHatch
changed the title
Add "APPNAME" headings in
Add "APPNAME" headings in Mar 24, 2024
.env
.env
, and move the "migrate" logic into appvars_create.sh
Use an associative array for default variable values. APP_VAR_VALUE["VARIABLE"]="default value" Change naming of variables used in script a bit.
Remove whitespace on blank line.
Add missing quotes around variable
Change to updating the `.env` file to after creating variables, to be sure they are sorted correctly.
Move initialization of `APP_LABEL_LIST` array to before for loop. It will get reset to empty before each pass of the for loop. Add a couple more comments.
Remove white space
Add/update comments
Commenting
Re-order variable definitions to make it a bit clearer. Add and move comments.
Do all processing in `env_update` internally in arrays, no temp files. Output the array to the new `.;env` file at the end.
Fix linting
No need to compact array after removing items.
Reduce duplicated "Built In" and "User Defined" section output to a loop for builtin/user user defined.
Shorten a variable name.
Fix unbound variable
More consistent variable naming.
Minor comment changes
No need to keep track of index positions of lines added to sections. Duplicates have already been handled by the associative array, the only duplicates would be from the variables added from the `.env.example` file.
Minor fix to comment... it's adding to a "section", not necessarily the "built in" section.
Replace all references to `mapfile` with `readarray`. They are the exact same command, but `readarray` seems clearer on what it does.
Ignore whitespace before and after variable when getting and setting variables, to allow ` VAR ='value'` Change `env_set` to a simple "Delete variable in file" and "Add variable to file".
Fix variable output in `fatal` command.
Ignore error when deleting a variable (the `.env` file may not exist).
Remove unused variable.
Remove whitespace
Simplify `grep/sed` commands to a single `sed` command to get all variable lines minus whitespace.
Comment out `debug` line
Move `env_update` after `appvarse_create_all` in the test. `env_update` adds the global variables and sorts.
Ignore whitespace before and after variables.
Ignore whitespace before and after variables.
Make all references to variables names upper case. Convert all variable names to upper case.
Change sorting of variables to sort using lower case, so that `_` sorts to the top. This will allow using variables starting with `_` in other variable definitions, such as `VAR="This expands ${_VAR2}"`. A variable must be defined BEFORE being expanded in another variable.
Fix linting
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.
Add headings for each app in the .env in the form of:
Pull request
Purpose
Describe the problem or feature in addition to a link to the issues.
Approach
How does this change address the problem?
Open Questions and Pre-Merge TODOs
Check all boxes as they are completed
Learning
Describe the research stage
Links to blog posts, patterns, libraries or addons used to solve this problem
Requirements
Check all boxes as they are completed