Fix folder output for script

This commit is contained in:
MCDeltaT 2024-04-03 15:46:13 +01:00
parent b52fea4122
commit 746c2a3ce5

View File

@ -565,32 +565,23 @@ if [ -z "$HAS_GAPPS" ]; then
else else
name2=-GApps-${ANDROID_API_MAP[$ANDROID_API]} name2=-GApps-${ANDROID_API_MAP[$ANDROID_API]}
fi fi
#if [[ "$MODEL_NAME" != "default" ]]; then
# name3="-as-$MODEL_NAME"
#fi
artifact_name=WSA_${WSA_VER}_${ARCH}_${WSA_REL}${name1}${name2} artifact_name=WSA_${WSA_VER}_${ARCH}_${WSA_REL}${name1}${name2}
#${name3}
short_artifact_name=WSA_${WSA_VER}_${ARCH}
[ "$REMOVE_AMAZON" ] && artifact_name+=-NoAmazon [ "$REMOVE_AMAZON" ] && artifact_name+=-NoAmazon
if [ -f "$OUTPUT_DIR" ]; then
rm -rf ${OUTPUT_DIR:?}
fi
if [ ! -d "$OUTPUT_DIR" ]; then if [ ! -d "$OUTPUT_DIR" ]; then
mkdir -p "$OUTPUT_DIR" mkdir -p "$OUTPUT_DIR"
fi fi
OUTPUT_PATH="${OUTPUT_DIR:?}/$artifact_name" OUTPUT_PATH="${OUTPUT_DIR:?}/$short_artifact_name"
if [ "$COMPRESS_FORMAT" != "none" ]; then mv "$WORK_DIR/wsa/$ARCH" "$OUTPUT_PATH"
mv "$WORK_DIR/wsa/$ARCH" "$WORK_DIR/wsa/$artifact_name" {
if [ -n "$COMPRESS_FORMAT" ]; then echo "artifact_folder=${short_artifact_name}"
FILE_EXT=".$COMPRESS_FORMAT" echo "artifact=${artifact_name}"
OUTPUT_PATH="$OUTPUT_PATH$FILE_EXT" echo "arch=${ARCH}"
fi echo "built=$(date -u +%Y%m%d%H%M%S)"
rm -f "${OUTPUT_PATH:?}" || abort echo "file_ext=${COMPRESS_FORMAT}"
if [ "$COMPRESS_FORMAT" = "7z" ]; then } >> "$GITHUB_OUTPUT"
echo "Compressing with 7z to $OUTPUT_PATH"
7z a "${OUTPUT_PATH:?}" "$WORK_DIR/wsa/$artifact_name" || abort
elif [ "$COMPRESS_FORMAT" = "zip" ]; then
echo "Compressing with zip to $OUTPUT_PATH"
7z -tzip a "$OUTPUT_PATH" "$WORK_DIR/wsa/$artifact_name" || abort
fi
else
rm -rf "${OUTPUT_PATH:?}" || abort
echo "Copying to $OUTPUT_PATH"
cp -r "$WORK_DIR/wsa/$ARCH" "$OUTPUT_PATH" || abort
fi