Skip to content

Commit

Permalink
add compress/package script
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeseese committed May 5, 2022
1 parent 0daee32 commit 4a3cc11
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .distribution-list
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Config
Resources
Source
LICENSE
README.md
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ Binaries
Intermediate
*.log
Dist
*.zip
31 changes: 31 additions & 0 deletions compress.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash

SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
PLUGIN_NAME=$(basename ${SCRIPT_DIR})

PLUGIN_VERSION=$(grep -Po '"VersionName": "\K[^"]*' ${PLUGIN_NAME}.uplugin)

FILES=$(cat .distribution-list)
FILES_WITH_FOLDER=$(echo ${FILES} | sed "s/[^ ]* */${PLUGIN_NAME}\/&/g")

cd ..

baseZip=${PLUGIN_NAME}-${PLUGIN_VERSION}.zip
/c/Program\ Files/7-Zip/7z a -tzip ${baseZip} ${FILES_WITH_FOLDER}

mv ${baseZip} ${PLUGIN_NAME}

cd ${PLUGIN_NAME}

PLUGIN_FILE_CONTENTS=$(cat ${PLUGIN_NAME}.uplugin)

versions="4.26.0 4.27.0 5.0.0"
for version in ${versions}
do
newContent=$(sed -r "s/\"EngineVersion\": \"[0-9]+\.[0-9]+\.[0-9]+\"/\"EngineVersion\": \"${version}\"/" ${PLUGIN_NAME}.uplugin)
newZip=${PLUGIN_NAME}-${PLUGIN_VERSION}-${version}.zip
cp $baseZip $newZip
echo "${newContent}" | /c/Program\ Files/7-Zip/7z a -tzip ${newZip} -si${PLUGIN_NAME}/${PLUGIN_NAME}.uplugin
done

rm ${baseZip}

0 comments on commit 4a3cc11

Please sign in to comment.