Skip to content

Commit

Permalink
Update arg options replacing dual characters with just one
Browse files Browse the repository at this point in the history
  • Loading branch information
QU3B1M committed Oct 29, 2024
1 parent 6f5dcb9 commit 66b91a1
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions build-scripts/baptizer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ function usage() {
echo -e "-r REVISION\t[Optional] Package revision, default is '0'."
echo -e "-m MIN\t[Optional] Use naming convention for minimal packages, default is 'false'."
echo -e "-x RELEASE\t[Optional] Use release naming convention, default is 'false'."
echo -e "-ph PLUGINS_HASH\t[Optional] Commit hash from the wazuh-indexer-plugins repository"
echo -e "-rh REPORTING_HASH\t[Optional] Commit hash from the wazuh-indexer-reporting repository"
echo -e "-l PLUGINS_HASH\t[Optional] Commit hash from the wazuh-indexer-plugins repository"
echo -e "-e REPORTING_HASH\t[Optional] Commit hash from the wazuh-indexer-reporting repository"
echo -e "-h help"
}

# ====
# Parse arguments
# ====
function parse_args() {
while getopts ":h:p:a:d:r:m:x:ph:rh:" arg; do
while getopts ":h:p:a:d:r:m:x:l:e:" arg; do
case $arg in
h)
usage
Expand All @@ -44,10 +44,10 @@ function parse_args() {
x)
IS_RELEASE=true
;;
ph)
l)
PLUGINS_HASH=$OPTARG
;;
rh)
e)
REPORTING_HASH=$OPTARG
;;
:)
Expand Down Expand Up @@ -155,10 +155,22 @@ function get_package_name() {
# ====
function main() {
parse_args "${@}"

# Add debugging
echo "Platform: $PLATFORM"
echo "Architecture: $ARCHITECTURE"
echo "Distribution: $DISTRIBUTION"
echo "Revision: $REVISION"
echo "Is Min: $IS_MIN"
echo "Is Release: $IS_RELEASE"
echo "Plugins Hash: $PLUGINS_HASH"
echo "Reporting Hash: $REPORTING_HASH"

get_package_name
echo "$PACKAGE_NAME"
}


GIT_COMMIT=$(git rev-parse --short HEAD)
VERSION=$(<VERSION)
main "${@}"

0 comments on commit 66b91a1

Please sign in to comment.