mirror of
https://github.com/Xevion/research-multipliers.git
synced 2025-12-15 00:12:49 -06:00
Add package testing script
This commit is contained in:
1
.gitattributes
vendored
1
.gitattributes
vendored
@@ -8,6 +8,7 @@
|
|||||||
# files that should not get included in a release zip
|
# files that should not get included in a release zip
|
||||||
README.md export-ignore
|
README.md export-ignore
|
||||||
.vscode export-ignore
|
.vscode export-ignore
|
||||||
|
.scripts export-ignore
|
||||||
.git export-ignore
|
.git export-ignore
|
||||||
.github export-ignore
|
.github export-ignore
|
||||||
.gitignore export-ignore
|
.gitignore export-ignore
|
||||||
|
|||||||
36
.scripts/package.sh
Executable file
36
.scripts/package.sh
Executable file
@@ -0,0 +1,36 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
cwd=$(pwd)
|
||||||
|
rootDir=$(git rev-parse --show-toplevel)
|
||||||
|
infoFile="$rootDir/info.json"
|
||||||
|
|
||||||
|
modName=$(jq -r '.name' $infoFile)
|
||||||
|
if [ -z "$modName" ]; then
|
||||||
|
echo "Error: Mod name not found in info.json"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
version=$(jq -r '.version' $infoFile)
|
||||||
|
if [ -z "$version" ]; then
|
||||||
|
echo "Error: Mod version not found in info.json"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
outputFile="${modName}_${version}.zip"
|
||||||
|
|
||||||
|
# git archive --format zip --prefix $modName/ --worktree-attributes --output ./$outputFile HEAD
|
||||||
|
|
||||||
|
cd $rootDir
|
||||||
|
mkdir $modName
|
||||||
|
cp -r ./*.lua info.json thumbnail.png locale/ LICENSE $modName/
|
||||||
|
rm -f $outputFile
|
||||||
|
zip -r $outputFile $modName
|
||||||
|
rm -rf $modName/
|
||||||
|
|
||||||
|
if [ -n "$1" ]; then
|
||||||
|
mv $outputFile "$1"
|
||||||
|
outputFile="$1/$(basename $outputFile)"
|
||||||
|
fi
|
||||||
|
|
||||||
|
cd $pwd
|
||||||
|
echo $outputFile
|
||||||
Reference in New Issue
Block a user