Skip to content

Commit 2af511b

Browse files
committed
New Feat: fct to update Dockerfile
1 parent 73ab7e5 commit 2af511b

File tree

2 files changed

+30
-7
lines changed

2 files changed

+30
-7
lines changed

.vscode/settings.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@
1010
"1091",
1111
"1083",
1212
"2148"
13-
]
13+
],
14+
"bashBeautify.tabSize": 2
1415
}

bashlava.sh

+28-6
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
: '
44
// COMMENT BLOCK //
5-
TO-DO comment section. Total of 3
5+
TO-DO comment section. Total of 4
66
77
PINNED issues on GH
88
#4 TO-DO & backlog 💪
@@ -16,20 +16,31 @@ PINNED issues on GH
1616
- 0o0o
1717
- Impacts: 💪 #4, 🎛️ #8, 🧠 #10, 🧵 #11, 🧨 #9
1818
19-
2019
_______________________________________________________________________________________
2120
_______________________________________________________________________________________
2221
PRIORITY 1 ____________________________________________________________________________
2322
23+
TODO
24+
## New Feat: I want fct v to impact Dockerfile
25+
- In fct v, check if a Dockerfile is present and update version if it exist
26+
- use flag: _file_do_not_exist
27+
- Impacts: 💪 #4, 🧠 #10
28+
29+
TODO
30+
## New Feat: I want fct v to be aware of SUB_DIR (ie Ghost v4 and v5)
31+
- fct `v` is not updating Dockerfile within SUB_DIR "
32+
- Need to add a flag: SUB_DIR, default: none
33+
- In fct v, check if a Dockerfile is present and update version if it exist
34+
- In fct v, check SUB_DIR flag is present
35+
- Impacts: 🧠 #10
36+
37+
2438
TODO
2539
BUG: there is a dir "~" create in every project
40+
observation in progress 2022-09-24_18h12
2641
#HOME
2742
/Users/#USER
2843
29-
TODO
30-
Manage SUB_DIR (ie Ghost v4 and v5)
31-
cmd `v` is broken
32-
3344
TODO
3445
Add Dockerfile FLAG to update version
3546
@@ -319,6 +330,16 @@ function version { # User_
319330
Condition_Attr_2_Must_Be_Provided
320331
Condition_Version_Must_Be_Valid
321332

333+
### Update version in Dockerfile
334+
_file_is="Dockerfile" _file_path_is="$(pwd)/${_file_is}" && Condition_File_Must_Be_Present
335+
if [[ "${_file_do_not_exist}" != "true" ]]; then
336+
sed -i '' "s|VERSION=\"[^\"]*\"|VERSION=\"${input_2}\"|" "${_file_path_is}"
337+
elif [[ "${_file_do_not_exist}" == "true" ]]; then
338+
echo "No Dockerfile, lets continue" > /dev/null 2>&1
339+
else
340+
my_message="FATAL: (version)" && Print_Fatal
341+
fi
342+
322343
# See FLAG 902
323344
_file_is=${_where_to_save_version} _file_path_is="$(pwd)/${_file_is}" && Condition_File_Must_Be_Present
324345
sed -i '' "s/^APP_VERSION=.*$/APP_VERSION=\"${input_2}\"/" "${_file_path_is}"
@@ -1016,6 +1037,7 @@ function Condition_File_Must_Be_Present {
10161037
echo "idempotent checkpoint passed" > /dev/null 2>&1
10171038
elif [[ ! -f "${_file_path_is}" ]]; then
10181039
my_message="Warning: no file: ${_file_path_is}" && Print_Warning_Stop
1040+
_file_do_not_exist="true"
10191041
else
10201042
my_message="FATAL: Condition_File_Must_Be_Present | ${_file_path_is}" && Print_Fatal
10211043
fi

0 commit comments

Comments
 (0)