mirror of
https://github.com/xavo95/repak.git
synced 2025-01-19 03:09:12 +00:00
53 lines
1.1 KiB
Bash
53 lines
1.1 KiB
Bash
|
#!/bin/bash
|
||
|
|
||
|
set -a
|
||
|
. config.sh
|
||
|
set +a
|
||
|
|
||
|
unreal-version-for() {
|
||
|
case "$1" in
|
||
|
5)
|
||
|
echo -n "$UNREAL_4_20"
|
||
|
;;
|
||
|
7)
|
||
|
echo -n "$UNREAL_4_21"
|
||
|
;;
|
||
|
8)
|
||
|
echo -n "$UNREAL_4_23"
|
||
|
;;
|
||
|
9)
|
||
|
echo -n "$UNREAL_4_25"
|
||
|
;;
|
||
|
11)
|
||
|
echo -n "$UNREAL_4_27"
|
||
|
;;
|
||
|
esac
|
||
|
}
|
||
|
|
||
|
generate() {
|
||
|
rm -r packs && mkdir packs
|
||
|
_version=(5 7 8 9 11)
|
||
|
_compress=("" "-compress")
|
||
|
_encrypt=("" "-encrypt")
|
||
|
_encryptindex=("" "-encryptindex")
|
||
|
echo "\"$(realpath "pack/*")\" \"../mount/point/\"" > input.txt
|
||
|
for version in "${_version[@]}"; do
|
||
|
for compress in "${_compress[@]}"; do
|
||
|
for encrypt in "${_encrypt[@]}"; do
|
||
|
for encryptindex in "${_encryptindex[@]}"; do
|
||
|
name="$version$compress$encrypt$encryptindex"
|
||
|
"$(unreal-version-for "$version")" "$(realpath "packs/pack_v${name//-/_}.pak")" -Create="$(realpath input.txt)" -cryptokeys="$(realpath crypto.json)" ${compress:+"$compress"} ${encrypt:+"$encrypt"} ${encryptindex:+"$encryptindex"} &
|
||
|
done
|
||
|
done
|
||
|
done
|
||
|
done
|
||
|
wait
|
||
|
rm input.txt
|
||
|
}
|
||
|
|
||
|
if [ $# -eq 0 ]; then
|
||
|
generate
|
||
|
else
|
||
|
"$@"
|
||
|
fi
|