codenamer.luau/scripts/install-deps.sh

35 lines
1.2 KiB
Bash
Raw Permalink Normal View History

2023-08-19 16:28:10 +01:00
#!/usr/bin/bash
2023-08-15 13:03:32 +01:00
set -e
declare -A DEPENDENCY_DATA=(
[author]='kdudedev'
[pkgname]='infinite-math'
[version]='1.3.2'
)
INFINITE_MATH_ENTRYPOINT_PATH="Packages/_Index/${DEPENDENCY_DATA[author]}_${DEPENDENCY_DATA[pkgname]}@${DEPENDENCY_DATA[version]}/${DEPENDENCY_DATA[pkgname]}/src/InfiniteMath/init.lua"
echo "[#] Constructed entrypoint file path for ${DEPENDENCY_DATA[pkgname]} -> $INFINITE_MATH_ENTRYPOINT_PATH"
2023-08-15 16:26:47 +01:00
INFINTE_MATH_SRC_DIR="$(dirname $INFINITE_MATH_ENTRYPOINT_PATH)"
2023-08-15 13:03:32 +01:00
function patch_infinite_math_for_lune() {
[[ -f "$INFINITE_MATH_ENTRYPOINT_PATH" ]] ||
echo "[!] Could not find ${DEPENDENCY_DATA[pkgname]} entrypoint file"
2023-08-15 16:26:47 +01:00
2023-08-15 13:03:32 +01:00
INFINITE_MATH_VALUES_DIR="$INFINTE_MATH_SRC_DIR/Values"
mv $INFINITE_MATH_VALUES_DIR/* "$INFINTE_MATH_SRC_DIR/"
2023-08-15 16:26:47 +01:00
rm -rf "$INFINITE_MATH_VALUES_DIR"
2023-08-15 13:03:32 +01:00
sed -i -e 's/local values = script.Values//g' $INFINITE_MATH_ENTRYPOINT_PATH
sed -i -e 's/values.Suffixes/".\/Suffixes.lua"/g' $INFINITE_MATH_ENTRYPOINT_PATH
sed -i -e 's/values.FullNames/".\/FullNames.lua"/g' $INFINITE_MATH_ENTRYPOINT_PATH
}
aftman install | sed 's/^/[aftman]: /' &&
wally install &&
patch_infinite_math_for_lune &&
2023-08-15 16:26:47 +01:00
darklua process $INFINITE_MATH_ENTRYPOINT_PATH "$INFINITE_MATH_SRC_DIR/infinite_math.lua" | sed 's/^/[darklua]: /'