-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New Feat: show(). It scans all functions avail in bashlava (#12)
* comments * comments * Move fct to example.sh * New Feat: show() #4 /sq * adding bashlava_config.sh but wip * Refactoring alias.sh * Refactoring alias.sh * Refactoring alias.sh * New Feat: show() #4 /sq
- Loading branch information
1 parent
e1fec29
commit ddad091
Showing
18 changed files
with
384 additions
and
1,260 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# wip brainstrom | ||
|
||
|
||
export APP_NAME="app_no_name" | ||
export APP_VERSION="0.1.0" | ||
|
||
|
||
export USING_PRIVATE_SCRIPTS="false" | ||
|
||
export USER_IS="${USER}" | ||
export LOG_LINE_NUMBERS="8" | ||
|
||
export DEFAULT_BRANCH="main" | ||
export DEV_BRANCH="edge_${USER_IS}" | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,72 +1,24 @@ | ||
#!/usr/bin/env bash | ||
|
||
function m { | ||
mainbranch | ||
} | ||
function e { | ||
edge | ||
} | ||
function c { | ||
commit | ||
} | ||
m() { "mainbranch" ; } | ||
e() { "edge" ; } | ||
c() { "commit" ; } | ||
h() { "help" ; } | ||
1() { "help" ; } | ||
te() { "test" ; } | ||
tt() { "test" ; } | ||
2() { "test" ; } | ||
v() { "version" ; } | ||
t() { "tag" ; } | ||
r() { "release" ; } | ||
om() { "git checkout ${default_branch}" ; } | ||
oe() { "git checkout edge" ; } | ||
l() { "log" ; } | ||
sq() { "squash" ; } | ||
s() { "show" ; } | ||
hash() { "git rev-parse HEAD && git rev-parse --short HEAD" ; } | ||
Print_Yellow() { "Print_Warning" ; } | ||
|
||
function h { | ||
help | ||
} | ||
function 1 { | ||
help | ||
} | ||
function te { | ||
test | ||
} | ||
function tt { | ||
test | ||
} | ||
function 2 { | ||
test | ||
} | ||
|
||
### not shortcuts: pr / ci / mrg | ||
|
||
function v { | ||
version | ||
} | ||
function t { | ||
tag | ||
} | ||
function r { | ||
release | ||
} | ||
function om { | ||
git checkout ${default_branch} | ||
} | ||
function oe { | ||
git checkout edge | ||
} | ||
function l { | ||
log | ||
} | ||
function sq { | ||
squash | ||
} | ||
|
||
function s { | ||
show | ||
} | ||
|
||
function hash { | ||
git rev-parse HEAD && git rev-parse --short HEAD | ||
} | ||
function Print_Yellow { | ||
Print_Warning | ||
} | ||
### capture common typos | ||
function sh { | ||
App_invalid_cmd | ||
} | ||
function oo { | ||
App_invalid_cmd | ||
} | ||
function App_invalid_cmd { | ||
export my_message="Invalid command" && Print_Warning_Stop | ||
} | ||
Utility_Invalid_Cmd() { "Utility_Invalid_Cmd" ; } | ||
sh() { "Utility_Invalid_Cmd" ; } | ||
00() { "Utility_Invalid_Cmd" ; } |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
one | ||
two | ||
three | ||
fct: ex_mapfile: | ||
one | ||
two | ||
three |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/usr/bin/env bash | ||
|
||
# As these fct scan the bashlava.sh file, it was seaching for itself causing display issues. | ||
# That why we run these fct under this file. | ||
|
||
function Show_Fct_Category_Filter { | ||
my_message="${_fct_name}" && Print_Blue && echo | ||
my_message="$(cat ${_file_path} | grep "${_filter}" | awk '{print $2}')" && Print_Gray && echo | ||
} | ||
|
||
# These pass attributs to 'Show_Fct_Category_Filter' | ||
Show_Fct_Category_Condition() { _fct_name="2) Condition" _filter="function Condition_" _file_path="${_path_bashlava}/bashlava.sh" && Show_Fct_Category_Filter ; } | ||
Show_Fct_Category_Core() { _fct_name="3) Core" _filter="function Core_" _file_path="${_path_bashlava}/bashlava.sh" && Show_Fct_Category_Filter ; } | ||
Show_Fct_Category_Example() { _fct_name="4) Example" _filter="function ex_" _file_path="${_path_components}/example.sh" && Show_Fct_Category_Filter ; } | ||
Show_Fct_Category_Print() { _fct_name="5) Print" _filter="function Print_" _file_path="${_path_bashlava}/bashlava.sh" && Show_Fct_Category_Filter ; } | ||
Show_Fct_Category_Show() { _fct_name="6) Show" _filter="function Show_" _file_path="${_path_bashlava}/bashlava.sh" && Show_Fct_Category_Filter ; } | ||
Show_Fct_Category_User() { _fct_name="7) User" _filter="# User_" _file_path="${_path_bashlava}/bashlava.sh" && Show_Fct_Category_Filter ; } | ||
Show_Fct_Category_Utility() { _fct_name="8) Utility" _filter="function Utility_" _file_path="${_path_components}/utilities.sh" && Show_Fct_Category_Filter ; } | ||
Show_Fct_Category_F1() { my_message="Function f1 does not exist yet." && Print_Gray && echo ; } | ||
Show_Fct_Category_F2() { my_message="Function f2 does not exist yet." && Print_Gray && echo ; } | ||
|
||
function Show_Fct_Category_All { | ||
arr=( "Alias" "Condition" "Core" "Example" "Print" "Show" "User" "Utility" ) | ||
for action in "${arr[@]}"; do | ||
Show_Fct_Category_"${action}" && sleep 0.2 | ||
done | ||
} | ||
|
||
# Function in alias are very different so I can't reuse 'Show_Fct_Category_Filter' | ||
function Show_Fct_Category_Alias { | ||
my_message="1) Alias" && Print_Blue && echo | ||
my_message="$(cat ${_path_components}/alias.sh | grep "()" | awk '{print $1}' | sed 's/()//g')" && Print_Gray && echo | ||
} |
Oops, something went wrong.