Skip to content

Commit

Permalink
fix: Fix undeclared variables
Browse files Browse the repository at this point in the history
  • Loading branch information
ribose-jeffreylau committed May 16, 2024
1 parent 7ca629d commit a917347
Showing 1 changed file with 20 additions and 17 deletions.
37 changes: 20 additions & 17 deletions rel-sign.sh
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ verify-remote() {
pushd "${TEMPDIR}" > /dev/null

local files=()
for path in "${TARGZ_BASEPATH}" "${ZIP_BASEPATH}"; do
for path in "${TARGZ_BASEPATH:-}" "${ZIP_BASEPATH:-}"; do
if [[ -n "${path}" ]]; then
files+=("${path}")
fi
Expand Down Expand Up @@ -643,32 +643,35 @@ main() {
export ZIP="${ZIP:-${NO_EXT_FILENAME}.zip}"
fi

export TARGZ_BASEPATH="${TARGZ##*/}"
export ZIP_BASEPATH="${ZIP##*/}"

TARGZ_NO_EXT="${TARGZ_NO_EXT:-${TARGZ_BASEPATH}}"
TARGZ_NO_EXT="${TARGZ_NO_EXT%.tar.gz}"
TARGZ_NO_EXT="${TARGZ_NO_EXT%.tgz}"
export TARGZ_NO_EXT
if [[ -n "${TARGZ:-}" ]]; then
export TARGZ_BASEPATH="${TARGZ##*/}"
TARGZ_NO_EXT="${TARGZ_NO_EXT:-${TARGZ_BASEPATH:-}}"
TARGZ_NO_EXT="${TARGZ_NO_EXT%.tar.gz}"
TARGZ_NO_EXT="${TARGZ_NO_EXT%.tgz}"
export TARGZ_NO_EXT
fi

ZIP_NO_EXT="${ZIP_NO_EXT:-${ZIP##*/}}"
ZIP_NO_EXT="${ZIP_NO_EXT%.*}"
export ZIP_NO_EXT
if [[ -n "${ZIP:-}" ]]; then
export ZIP_BASEPATH="${ZIP##*/}"
ZIP_NO_EXT="${ZIP_NO_EXT:-${ZIP##*/}}"
ZIP_NO_EXT="${ZIP_NO_EXT%.*}"
export ZIP_NO_EXT
fi

export DEFAULT_EXPANDED_PATH="${REPOLAST}-${VERSION}"

# Choose a name for the expanded targz file
if [[ -z "${LOCAL_ZIP:-}" ]]; then
export EXPANDED_ZIP="${DEFAULT_EXPANDED_PATH}"
else
if [[ -n "${LOCAL_ZIP:-}" ]]; then
export EXPANDED_ZIP="${ZIP_NO_EXT}"
else
export EXPANDED_ZIP="${DEFAULT_EXPANDED_PATH}"
fi

# Choose a name for the expanded targz file
if [[ -z "${LOCAL_TARGZ:-}" ]]; then
export EXPANDED_TARGZ="${DEFAULT_EXPANDED_PATH}"
else
if [[ -n "${LOCAL_TARGZ:-}" ]]; then
export EXPANDED_TARGZ="${TARGZ_NO_EXT}"
else
export EXPANDED_TARGZ="${DEFAULT_EXPANDED_PATH}"
fi

# Choose a name for the checksum file
Expand Down

0 comments on commit a917347

Please sign in to comment.