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

New Feat: Add SUB_DIR logic #56

Merged
merged 1 commit into from
Sep 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .bl_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ CFG_DEFAULT_BRANCH="main"
CFG_DEFAULT_DEV_BRANCH="edge"
CFG_USER_IS="${USER}"

### Needed when projects are under sub directories
CFG_SUB_DIR="none"

### manage your custom scripts under this directory /private/**.sh
CFG_USE_PRIVATE_DIRECTORY="false"
CFG_USE_GPG_SIGNATURE="false"
Expand Down
28 changes: 14 additions & 14 deletions bashlava.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,12 @@ ________________________________________________________________________________
PRIORITY 1 ____________________________________________________________________________

TODO
## New Feat: fct `v` to update Dockerfile
- In fct v, check if a Dockerfile is present and update version if it exist
- use flag: _file_do_not_exist
- Impacts: 💪 #4, 🧠 #10

TODO
## New Feat: I want fct v to be aware of SUB_DIR (ie Ghost v4 and v5)
- fct `v` is not updating Dockerfile within SUB_DIR "
## New Feat: Add SUB_DIR logic (ie Ghost v4 and v5)
- fct v is not updating Dockerfile in SUB_DIR
- Need to add a flag: SUB_DIR, default: none
- In fct v, check if a Dockerfile is present and update version if it exist
- In fct v, check SUB_DIR flag is present
- Impacts: 🧠 #10

- Then fct v will be able to update the Dockerfile in the SUB_DIR or at the root
- Impacts: 💪 #4, 🧠 #10

TODO
BUG: there is a dir "~" create in every project
Expand Down Expand Up @@ -78,7 +71,6 @@ WITH THIS:
- create ci for using shellcheck
- execute test()


0o0o
Fix dependabot read-only annoyance
https://github.com/marketplace/actions/fetch-metadata-from-dependabot-prs
Expand Down Expand Up @@ -330,14 +322,22 @@ function version { # User_
Condition_Attr_2_Must_Be_Provided
Condition_Version_Must_Be_Valid

### SUB_DIR
if [[ "${CFG_SUB_DIR}" != "none" ]]; then
_file_is="Dockerfile" _file_path_is="$(pwd)/${CFG_SUB_DIR}/${_file_is}" && Condition_File_Optionnally_Present
elif [[ "${CFG_SUB_DIR}" == "none" ]]; then
_file_is="Dockerfile" _file_path_is="$(pwd)/${_file_is}" && Condition_File_Optionnally_Present
else
my_message="FATAL: (CFG_SUB_DIR)" && Print_Fatal
fi

### Update version in Dockerfile
_file_is="Dockerfile" _file_path_is="$(pwd)/${_file_is}" && Condition_File_Optionnally_Present
if [[ "${_file_do_not_exist}" != "true" ]]; then
sed -i '' "s|VERSION=\"[^\"]*\"|VERSION=\"${input_2}\"|" "${_file_path_is}"
elif [[ "${_file_do_not_exist}" == "true" ]]; then
echo "No Dockerfile, lets continue" > /dev/null 2>&1
else
my_message="FATAL: (version)" && Print_Fatal
my_message="FATAL: (_file_do_not_exist)" && Print_Fatal
fi

# See FLAG 902
Expand Down