Skip to content
This repository was archived by the owner on May 13, 2022. It is now read-only.

Commit f6d7f80

Browse files
committed
Code refactor, fct: App_Show_version
1 parent 2540ce5 commit f6d7f80

File tree

1 file changed

+17
-15
lines changed

1 file changed

+17
-15
lines changed

bashlava.sh

+17-15
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ function mainbranch {
1616
log
1717
}
1818

19+
# TODO have this branch created with a unique ID to avoid conflicts with other developers
20+
1921
function edge {
2022
# it assumes there will be no conflict with anybody else
2123
# as I'm the only person using 'edge'.
@@ -153,8 +155,6 @@ function squash {
153155
function test {
154156
# test our script & fct. Idempotent bash script
155157

156-
help
157-
158158
figlet_message="bashLaVa" && App_figlet
159159

160160
my_message="Attributes:" App_Blue
@@ -185,6 +185,7 @@ function test {
185185

186186
echo
187187
my_message="Check versions:" App_Blue
188+
input_2="not_set"
188189
App_Show_version
189190

190191
echo
@@ -509,22 +510,23 @@ file_is="_entrypoint.sh"
509510
# TODO logic '"${input_2}" == "not_set"' prevent to call it from test
510511

511512
function App_Show_version {
512-
# Show version from three sources
513-
if [[ "${input_2}" == "not_set" ]]; then
514-
echo && my_message="Version checkpoints:" && App_Blue &&\
513+
### Show version from three sources
514+
App_Is_input_2_empty_as_it_should
515+
516+
echo && my_message="Version checkpoints:" && App_Blue &&\
515517
### dockerfile
516-
my_message="${app_version} < VERSION in Dockerfile" App_Gray
517-
my_message="${app_release} < RELEASE in Dockerfile" App_Gray
518+
my_message="${app_version} < VERSION in Dockerfile" App_Gray
519+
my_message="${app_release} < RELEASE in Dockerfile" App_Gray
518520
### tag
519-
latest_tag="$(git describe --tags --abbrev=0)"
520-
_var_name="latest_tag" _is_it_empty=$(echo ${latest_tag}) && App_Does_Var_Empty
521-
my_message="${latest_tag} < TAG on mainbranch" App_Gray
521+
latest_tag="$(git describe --tags --abbrev=0)"
522+
_var_name="latest_tag" _is_it_empty=$(echo ${latest_tag}) && App_Does_Var_Empty
523+
my_message="${latest_tag} < TAG on mainbranch" App_Gray
522524
### release
523-
release_latest=$(curl -s https://api.github.com/repos/${github_user}/${app_name}/releases/latest | \
524-
grep tag_name | awk -F ': "' '{ print $2 }' | awk -F '",' '{ print $1 }')
525-
_var_name="release_latest" _is_it_empty=$(echo ${release_latest}) && App_Does_Var_Empty
526-
my_message="${release_latest} < RELEASE on https://github.com/${github_user}/${app_name}/releases/tag/${release_latest}" && App_Gray && echo
527-
fi
525+
release_latest=$(curl -s https://api.github.com/repos/${github_user}/${app_name}/releases/latest | \
526+
grep tag_name | awk -F ': "' '{ print $2 }' | awk -F '",' '{ print $1 }')
527+
_var_name="release_latest" _is_it_empty=$(echo ${release_latest}) && App_Does_Var_Empty
528+
my_message="${release_latest} < RELEASE on https://github.com/${github_user}/${app_name}/releases/tag/${release_latest}" && App_Gray && echo
529+
528530
}
529531

530532
function App_Show_release {

0 commit comments

Comments
 (0)