Skip to content

Commit

Permalink
UX: Add config to dummy()
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalandy committed May 21, 2022
1 parent 22ed69c commit f2ad8b4
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 24 deletions.
15 changes: 11 additions & 4 deletions .bl_env.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

### DO NOT update these vars.
### Because of these three vars, you must create a use `.bl_override.sh`
### DO NOT update these vars (`.bl_env.sh`)
### Override vars from `.bl_override.sh` Get template https://github.com/firepress-org/mycrypt/blob/master/.bl_override.sh
APP_NAME="bashlava"
GITHUB_USER="firepress-org"
APP_VERSION="1.49.2"
Expand All @@ -15,12 +15,19 @@ CFG_USER_IS="${USER}"

### manage your custom scripts under this directory /private/**.sh
CFG_USE_PRIVATE_DIRECTORY="false"
CFG_USE_GPG_SIGNATURE="false"

### function options
### edge
CFG_EDGE_EXTENTED="false" # not coded yet

### log()
CFG_LOG_LINE_NBR_SHORT="4" # log() default line number
CFG_LOG_LINE_NBR_LONG="12" # log() default line number
CFG_USE_GPG_SIGNATURE="false"

### dummy()
CFG_DUMMY_CUSTOM_MSG="false"
CFG_DUMMY_CUSTOM_MSG_IS="Alt dummy message"

CFG_RELEASE_POPUP="false" # not coded yet
CFG_TEST_SHOW_VARS="false" # test extension
CFG_TEST_OPTIONAL_APPS="false" # test extension
Expand Down
48 changes: 29 additions & 19 deletions bashlava.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,31 @@
// COMMENT BLOCK //
TO-DO comment section. Total of 3
PINNED issues on GH _
issue #4 TO-DO & backlog _
issue #8 UX _
issue #9 Bugfix _
issue #10 Logic & Condition _
issue #11 docs _
PR Title: New Feat: 0o0o
PINNED issues on GH
#4 TO-DO & backlog 💪
#8 UX 🎛️
#10 Logic & Condition 🧠
#11 docs 🧵
#9 Bugfix 🧨
## New Feat: 0o0o
- 0o0o
- 0o0o
- Impact on: #4, #8, #9 #10
## Impacts: 💪 #4, 🎛️ #8, 🧠 #10, 🧵 #11, 🧨 #9
_______________________________________________________________________________________
_______________________________________________________________________________________
PRIORITY 1 ____________________________________________________________________________
TODO
Fix tag() to avoid prompt
- Impact on: #9
TODO
## UX: Add config to dummy()
- alternate message can be set by the user
- CFG_DUMMY_CUSTOM_MSG, CFG_DUMMY_CUSTOM_MSG_IS
## Impacts: 🎛️ #8
TODO
gc()
Expand All @@ -47,6 +52,8 @@ ________________________________________________________________________________
PRIORITY 2 ____________________________________________________________________________
BUG: tag() still prompt on bashlava, but does not on project mycrypt .. ?
TODO
Optimize code: Instead of creating custom var simply use %1 %2 <=dollar sign
Expand Down Expand Up @@ -482,12 +489,20 @@ function dummy { # User_
_from_fct="d"
_in_file="./docs/DUMMY.md"

# create two commits in a row
# create two dummy commits in a row
for lineID in $(seq 1 2); do
date_nano="$(date +%Y-%m-%d_%HH%Ms%S-%N)"
_hash=$(echo "${date_nano} ${lineID}" | sha256sum | awk '{print $1}')
_hash_four_last="${_hash: -4}"
echo "Dummy Commit ${lineID} - $(date +%Y-%m-%d_%HH%M_%S) - ${_hash}" >> "${_in_file}"

if [[ "${CFG_DUMMY_CUSTOM_MSG}" == "false" ]]; then
echo "Dummy Commit ${lineID} - $(date +%Y-%m-%d_%HH%M_%S) - ${_hash}" >> "${_in_file}"
elif [[ "${CFG_DUMMY_CUSTOM_MSG}" == "true" ]]; then
echo "${CFG_DUMMY_CUSTOM_MSG_IS} ${lineID}" >> "${_in_file}"
else
my_message="FATAL: Config is broken regarding: 'CFG_TEST_SHOW_VARS'." && Print_Fatal
fi

git add -A && git commit -m "Dummy Commit ${lineID} - ${_hash_four_last}"
done

Expand Down Expand Up @@ -1180,9 +1195,6 @@ function Core_Load_Config_Default {
}

function Core_Load_Config_Override {

### Load override config

# Load override config if it exist
if [[ -f "$(pwd)/${OVERRIDE_CONFIG_FILE_NAME_IS}" ]]; then
_where_to_save_version="${OVERRIDE_CONFIG_FILE_NAME_IS}"
Expand All @@ -1193,7 +1205,6 @@ function Core_Load_Config_Override {
my_message="FATAL: Core_Load_Config_Override() A" && Print_Fatal
fi


# Logic depending on which projet we are working on
if [[ "${APP_NAME}" == "bashlava" ]]; then
#Logic for bashlava itself
Expand All @@ -1208,7 +1219,6 @@ function Core_Load_Config_Override {
elif [[ ! -f "$(pwd)/${OVERRIDE_CONFIG_FILE_NAME_IS}" ]]; then
my_message="WARNING: Config file (${OVERRIDE_CONFIG_FILE_NAME_IS}) is not configured." && Print_Warning
my_message="See README for installation details." && Print_Warning & sleep 2

else
my_message="FATAL: Core_Load_Config_Override() B" && Print_Fatal
fi
Expand Down
1 change: 1 addition & 0 deletions docs/DUMMY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# DUMMY commits here
2 changes: 1 addition & 1 deletion docs/help.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
- `s` ....... |`show`every functions per categories ... | _standalone_
- `h` ....... |`help`.................................. | _standalone_
- `test` .... |`test`if bashLaVa works properly ....... | _standalone_
- `gc` ...... | git-crypt utility ..................... | _standalone_ or usage: gc on
- `gc` ...... | git-crypt utility ..................... | _standalone_ or usage: gc (sub-cmd)
- `l` ....... | show`log`.............................. | _standalone_
- `sv` ...... | show`version`.......................... | _standalone_
- `oe` ...... | check`out`edge ......(does not fetch) . | _standalone_
Expand Down

0 comments on commit f2ad8b4

Please sign in to comment.