-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add modules shellcheck, gitleaks, add scripts to git (#23)
- Loading branch information
1 parent
bcdbece
commit cbb8a94
Showing
105 changed files
with
1,326 additions
and
2,237 deletions.
There are no files selected for viewing
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,19 +1,11 @@ | ||
#!/usr/bin/env bash | ||
# template-module-base: 2.0.0 | ||
# template-module-base: 2.2.0 | ||
####################################### | ||
# X_MODULE_NAME_X / Lib | ||
# | ||
# Version: 1.0.0 | ||
# | ||
####################################### | ||
# Copyright [2024] [[email protected]] | ||
# Copyright SerDigital64 - https://github.com/serdigital64 | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0 | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
|
@@ -25,14 +17,17 @@ | |
# Imports | ||
# | ||
|
||
# X_IMPORTS_PLACEHOLDER_X | ||
# shellcheck disable=SC2015 source-path=SCRIPTDIR/../../lib/bl64 | ||
source "${S64_CORE_PATH_BL64}/bashlib64-module-bsh.bash" || | ||
{ echo 'Error: unable to load bashlib64' && exit 1; } | ||
|
||
# | ||
# Globals | ||
# | ||
|
||
# shellcheck disable=SC2034 | ||
{ | ||
declare S64_X_MODULE_CAPS_X_VERSION='1.0.0' | ||
# X_GLOBALS_PLACEHOLDER_X | ||
} | ||
|
||
|
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,23 +1,15 @@ | ||
#!/usr/bin/env bash | ||
# template-module-lib: 2.0.0 | ||
# template-module-base: 2.0.0 | ||
# template-module-lib: 2.2.0 | ||
# template-module-base: 2.2.0 | ||
# template-module-setup: 2.0.0 | ||
# template-module-cli: 1.1.0 | ||
# template-module-vars: 1.0.0 | ||
####################################### | ||
# X_MODULE_NAME_X / Lib | ||
# | ||
# Version: 1.0.0 | ||
# | ||
####################################### | ||
# Copyright [2024] [[email protected]] | ||
# Copyright SerDigital64 - https://github.com/serdigital64 | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0 | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
|
@@ -30,7 +22,11 @@ | |
# | ||
|
||
# shellcheck disable=SC2015 source-path=SCRIPTDIR/../../lib/bl64 | ||
source "${S64_CORE_PATH_BL64}/bashlib64-module-bsh.bash" || | ||
source "${S64_CORE_PATH_BL64}/bashlib64-module-bsh.bash" && | ||
source "${S64_CORE_PATH_BL64}/bashlib64-module-fmt.bash" && | ||
source "${S64_CORE_PATH_BL64}/bashlib64-module-xsv.bash" && | ||
source "${S64_CORE_PATH_BL64}/bashlib64-module-txt.bash" && | ||
source "${S64_CORE_PATH_BL64}/bashlib64-module-fs.bash" || | ||
{ echo 'Error: unable to load bashlib64' && exit 1; } | ||
|
||
# | ||
|
@@ -39,7 +35,9 @@ source "${S64_CORE_PATH_BL64}/bashlib64-module-bsh.bash" || | |
|
||
# shellcheck disable=SC2034 | ||
{ | ||
declare S64_X_MODULE_CAPS_X_PATH_CLI="${S64_X_MODULE_CAPS_X_PATH_CLI:-X_MODULE_PATH_CLI_X}" | ||
declare S64_X_MODULE_CAPS_X_VERSION='1.0.0' | ||
declare S64_X_MODULE_CAPS_X_PATH_CLI="${S64_X_MODULE_CAPS_X_PATH_CLI:-}" | ||
# X_GLOBALS_PLACEHOLDER_X | ||
} | ||
|
||
# | ||
|
@@ -49,13 +47,13 @@ source "${S64_CORE_PATH_BL64}/bashlib64-module-bsh.bash" || | |
function s64_X_MODULE_X_lib_setup() { | ||
bl64_dbg_app_show_function | ||
if [[ -z "$S64_X_MODULE_CAPS_X_PATH_CLI" ]]; then | ||
S64_X_MODULE_CAPS_X_PATH_CLI="$(bl64_bsh_command_locate 'argocd')" | ||
S64_X_MODULE_CAPS_X_PATH_CLI="$(bl64_bsh_command_locate 'X_CLI_COMMAND_X')" | ||
else | ||
bl64_check_command "$S64_X_MODULE_CAPS_X_PATH_CLI" | ||
fi | ||
} | ||
|
||
function s64_X_MODULE_X_lib_run_X_MODULE_CLI_NAME_X() { | ||
function s64_X_MODULE_X_lib_run_X_CLI_COMMAND_X() { | ||
bl64_dbg_app_show_function "$@" | ||
local verbose_flag='--verbose' | ||
bl64_msg_app_verbose_enabled || verbose_flag=' ' | ||
|
@@ -66,3 +64,5 @@ function s64_X_MODULE_X_lib_run_X_MODULE_CLI_NAME_X() { | |
"$@" | ||
bl64_dbg_app_trace_stop | ||
} | ||
|
||
# X_FUNCTIONS_PLACEHOLDER_X |
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,44 +1,31 @@ | ||
#!/usr/bin/env bash | ||
# template-one-base: 1.0.0 | ||
# template-one-base: 2.0.0 | ||
# template-import: 2.0.1 | ||
####################################### | ||
# X_MODULE_NAME_X / [X_SUBMODULE_NAME_X /] X_APP_NAME_X | ||
# | ||
# Version: 1.0.0 | ||
# | ||
####################################### | ||
# Copyright [2024] [[email protected]] | ||
# Copyright SerDigital64 - https://github.com/serdigital64 | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0 | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
####################################### | ||
|
||
# | ||
# Imports | ||
# | ||
|
||
# X_IMPORTS_PLACEHOLDER_X | ||
declare S64_CORE_PATH_ROOT="${S64_CORE_PATH_ROOT:-/opt/sysop64}" | ||
# shellcheck source-path=SCRIPTDIR/.. | ||
source "${S64_CORE_PATH_ROOT}/core/core-lib" && source "${S64_CORE_PATH_ROOT}/core/X_MODULE_X-lib" || { echo "Error: unable to load module library" && exit 1; } | ||
# shellcheck disable=SC2015 source-path=SCRIPTDIR/../../lib/bl64 | ||
source "${S64_CORE_PATH_BL64}/bashlib64-core.bash" || { echo 'Error: unable to load bashlib64' && exit 1; } | ||
|
||
# | ||
# Functions | ||
# | ||
# X_GLOBALS_PLACEHOLDER_X | ||
|
||
# X_FUNCTIONS_PLACEHOLDER_X | ||
|
||
# | ||
# Main | ||
# | ||
|
||
declare command='X_COMMAND_X' | ||
|
||
# X_MAIN_PLACEHOLDER_X | ||
bl64_lib_script_version_set '1.0.0' | ||
bl64_dbg_set_level "$S64_CORE_SET_DEBUG" && bl64_msg_set_level "$S64_CORE_SET_VERBOSE" && initialize || exit $? | ||
bl64_msg_show_batch_start "$BL64_SCRIPT_ID" | ||
# X_COMMAND_PLACEHOLDER_X | ||
|
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,53 +1,37 @@ | ||
#!/usr/bin/env bash | ||
# template-one: 2.0.0 | ||
# template-one-base: 1.0.0 | ||
# template-import: 2.0.0 | ||
# template-one: 3.0.0 | ||
# template-one-base: 2.0.0 | ||
####################################### | ||
# X_MODULE_NAME_X / [X_SUBMODULE_NAME_X /] X_APP_NAME_X | ||
# | ||
# Version: 1.0.0 | ||
# | ||
####################################### | ||
# Copyright [2024] [[email protected]] | ||
# Copyright SerDigital64 - https://github.com/serdigital64 | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0 | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
####################################### | ||
|
||
# | ||
# Imports | ||
# | ||
|
||
declare S64_CORE_PATH_ROOT="${S64_CORE_PATH_ROOT:-/opt/sysop64}" | ||
# shellcheck source-path=SCRIPTDIR/.. | ||
source "${S64_CORE_PATH_ROOT}/core/core-lib" && source "${S64_CORE_PATH_ROOT}/core/X_MODULE_X-lib" || { echo "Error: unable to load module library" && exit 1; } | ||
# shellcheck disable=SC2015 source-path=SCRIPTDIR/../../lib/bl64 | ||
source "${S64_CORE_PATH_BL64}/bashlib64-core.bash" || { echo 'Error: unable to load bashlib64' && exit 1; } | ||
|
||
# | ||
# Functions | ||
# | ||
# X_FUNCTIONS_PLACEHOLDER_X | ||
|
||
function initialize() { | ||
bl64_dbg_app_show_function | ||
s64_X_MODULE_X_lib_setup || return $? | ||
# X_INIT_PLACEHOLDER_X | ||
} | ||
|
||
# | ||
# Main | ||
# | ||
|
||
# X_MAIN_PLACEHOLDER_X | ||
bl64_lib_script_version_set '1.0.0' | ||
bl64_dbg_set_level "$S64_CORE_SET_DEBUG" && bl64_msg_set_level "$S64_CORE_SET_VERBOSE" && initialize || exit $? | ||
bl64_msg_show_batch_start "$BL64_SCRIPT_ID" | ||
s64_X_MODULE_X_lib_run_X_MODULE_CLI_NAME_X \ | ||
# X_COMMAND_PLACEHOLDER_X | ||
bl64_msg_show_batch_finish $? "$BL64_SCRIPT_ID" |
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,19 +1,12 @@ | ||
#!/usr/bin/env bash | ||
# template-task-base: 1.1.0 | ||
# template-task-base: 2.0.0 | ||
# template-import: 2.0.1 | ||
####################################### | ||
# X_MODULE_NAME_X / [X_SUBMODULE_NAME_X /] X_APP_NAME_X | ||
# | ||
# Version: 1.0.0 | ||
# | ||
####################################### | ||
# Copyright [2024] [[email protected]] | ||
# Copyright SerDigital64 - https://github.com/serdigital64 | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0 | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
|
@@ -25,6 +18,12 @@ | |
# Imports | ||
# | ||
|
||
declare S64_CORE_PATH_ROOT="${S64_CORE_PATH_ROOT:-/opt/sysop64}" | ||
# shellcheck source-path=SCRIPTDIR/.. | ||
source "${S64_CORE_PATH_ROOT}/core/core-lib" && source "${S64_CORE_PATH_ROOT}/core/X_MODULE_X-lib" || { echo "Error: unable to load module library" && exit 1; } | ||
# shellcheck disable=SC2015 source-path=SCRIPTDIR/../../lib/bl64 | ||
source "${S64_CORE_PATH_BL64}/bashlib64-core.bash" || { echo 'Error: unable to load bashlib64' && exit 1; } | ||
|
||
# | ||
# Globals | ||
# | ||
|
@@ -42,25 +41,9 @@ function X_COMMAND_X() { | |
|
||
function initialize() { | ||
bl64_dbg_app_show_function | ||
bl64_check_parameter 'COMMAND' || | ||
{ help && return 1; } | ||
|
||
bl64_check_parameter 'COMMAND' || { help && return 1; } | ||
s64_X_MODULE_X_lib_setup | ||
# X_INIT_PLACEHOLDER_X | ||
return 0 | ||
} | ||
|
||
function help() { | ||
bl64_msg_show_usage \ | ||
'-x [-V Verbose] [-D Debug] [-h]' \ | ||
'X_MODULE_NAME_X / [X_SUBMODULE_NAME_X /] X_APP_NAME_X' \ | ||
' | ||
-x : X_COMMAND_INFO_X | ||
' ' | ||
-h : Show help | ||
' ' | ||
-V Verbose : Set verbosity level. Format: one of BL64_MSG_VERBOSE_* | ||
-D Debug : Enable debugging mode. Format: one of BL64_DBG_TARGET_* | ||
' | ||
} | ||
|
||
# | ||
|
@@ -70,14 +53,23 @@ function help() { | |
declare COMMAND="$BL64_VAR_NULL" | ||
declare OPTION='' | ||
|
||
(($# == 0)) && help && exit 1 | ||
bl64_lib_script_version_set '1.0.0' | ||
bl64_msg_help_usage_set 'X_HELP_CLI_X [-V Verbose] [-D Debug] [-h]' | ||
bl64_msg_help_about_set 'X_HELP_ABOUT_X' | ||
# shellcheck disable=SC2016 | ||
bl64_msg_help_parameters_set \ | ||
'X_HELP_PARAMETERS_X | ||
-V Verbose : Set verbosity level. Format: one of BL64_MSG_VERBOSE_* | ||
-D Debug : Enable debugging mode. Format: one of BL64_DBG_TARGET_*' | ||
|
||
(($# == 0)) && bl64_msg_help_show && exit 1 | ||
while getopts ':xV:D:h' OPTION; do | ||
case "$OPTION" in | ||
x) COMMAND='X_COMMAND_X' ;; | ||
V) S64_CORE_SET_VERBOSE="$OPTARG" ;; | ||
D) S64_CORE_SET_DEBUG="$OPTARG" ;; | ||
h) help && exit 0 ;; | ||
*) help && exit 1 ;; | ||
h) bl64_msg_help_show && exit 0 ;; | ||
*) bl64_msg_help_show && exit 1 ;; | ||
esac | ||
done | ||
bl64_dbg_set_level "$S64_CORE_SET_DEBUG" && bl64_msg_set_level "$S64_CORE_SET_VERBOSE" && initialize || exit $? | ||
|
Oops, something went wrong.