Skip to content

Commit 486f1e5

Browse files
committed
Minor changes
1 parent 37bda2d commit 486f1e5

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

build.sh

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,15 @@ _init_dir="$(pwd)" || ui_error 'Failed to read the current dir'
108108
# Set output dir
109109
OUT_DIR="${MAIN_DIR:?}/output"
110110

111+
# Set module info
112+
MODULE_ID="$(simple_get_prop 'id' "${MAIN_DIR:?}/zip-content/module.prop")" || ui_error 'Failed to parse the module id string'
113+
MODULE_VER="$(simple_get_prop 'version' "${MAIN_DIR:?}/zip-content/module.prop")" || ui_error 'Failed to parse the module version string'
114+
MODULE_AUTHOR="$(simple_get_prop 'author' "${MAIN_DIR:?}/zip-content/module.prop")" || ui_error 'Failed to parse the module author string'
115+
case "${MODULE_VER:?}" in
116+
*'-alpha') MODULE_IS_ALPHA='true' ;;
117+
*) MODULE_IS_ALPHA='false' ;;
118+
esac
119+
111120
# Set short commit ID
112121
ZIP_SHORT_COMMIT_ID=''
113122
if test "${CI:-false}" != 'false'; then
@@ -133,7 +142,7 @@ if test "${OPENSOURCE_ONLY:?}" != 'false'; then
133142
printf 'ZIP_SHORT_COMMIT_ID=%s\n' "${ZIP_SHORT_COMMIT_ID?}"
134143
printf 'ZIP_BUILD_TYPE=%s\n' "${BUILD_TYPE?}"
135144
printf 'ZIP_BUILD_TYPE_SUPPORTED=%s\n' 'false'
136-
printf 'ZIP_IS_ALPHA=\n'
145+
printf 'ZIP_IS_ALPHA=%s\n' "${MODULE_IS_ALPHA?}"
137146
printf 'ZIP_SHA256=\n'
138147
printf 'ZIP_MD5=\n'
139148
} >> "${GITHUB_OUTPUT?}"
@@ -166,11 +175,7 @@ if test -z "${TEMP_DIR}"; then ui_error 'Failed to create our temp dir'; fi
166175
# Empty our temp dir (should be already empty, but we must be sure)
167176
rm -rf "${TEMP_DIR:?}"/* || ui_error 'Failed to empty our temp dir'
168177

169-
# Set filename and version
170-
MODULE_ID="$(simple_get_prop 'id' "${MAIN_DIR:?}/zip-content/module.prop")" || ui_error 'Failed to parse the module id string'
171-
MODULE_VER="$(simple_get_prop 'version' "${MAIN_DIR:?}/zip-content/module.prop")" || ui_error 'Failed to parse the module version string'
172-
MODULE_AUTHOR="$(simple_get_prop 'author' "${MAIN_DIR:?}/zip-content/module.prop")" || ui_error 'Failed to parse the module author string'
173-
178+
# Set filename
174179
FILENAME_COMMIT_ID="g${ZIP_SHORT_COMMIT_ID?}"
175180
test "${FILENAME_COMMIT_ID:?}" != 'g' || FILENAME_COMMIT_ID='NOGIT'
176181
FILENAME_START="${MODULE_ID:?}-${MODULE_VER:?}-"
@@ -192,11 +197,6 @@ fi
192197
FILENAME="${FILENAME_START:?}${FILENAME_MIDDLE:?}${FILENAME_END:?}"
193198
FILENAME_EXT='.zip'
194199

195-
case "${MODULE_VER:?}" in
196-
*'-alpha') MODULE_IS_ALPHA='true' ;;
197-
*) MODULE_IS_ALPHA='false' ;;
198-
esac
199-
200200
# shellcheck source=SCRIPTDIR/addition.sh
201201
. "${MAIN_DIR}/addition.sh"
202202

0 commit comments

Comments
 (0)