might work now..

This commit is contained in:
pika 2025-05-25 12:58:55 +02:00
parent 4f104d32be
commit badba29a10

27
ly.sh
View file

@ -105,7 +105,7 @@
esac esac
} }
check-path() { check-zig-path() {
if ! command_exists zig; then if ! command_exists zig; then
export PATH="$ZIG_PATH:$PATH" export PATH="$ZIG_PATH:$PATH"
else else
@ -114,6 +114,7 @@
} }
check-zig() { check-zig() {
if command_exists zig; then
local version_needed version_current local version_needed version_current
version_needed=0.14.0 version_needed=0.14.0
@ -121,6 +122,13 @@
if [ "$version_current" != "$version_needed" ]; then if [ "$version_current" != "$version_needed" ]; then
throw "Version missmatch, you have $version_current, needed is $version_needed" throw "Version missmatch, you have $version_current, needed is $version_needed"
return 69
fi
# return no exit code if zig version is correct
return 0
else
return 69
fi fi
} }
@ -168,11 +176,13 @@
echo-error "${err:-}" echo-error "${err:-}"
fi fi
line # line
pen bold green "ZIG_PATH=$zig" # pen bold green "ZIG_PATH=$zig"
line # line
[[ -d "$zig" ]] && ZIG_PATH="$zig" || throw bold red "Something went terribly wrong!" [[ -d "$zig" ]] && ZIG_PATH="$zig" || throw bold red "Something went terribly wrong!"
check-zig-path
} }
get-ly() { get-ly() {
@ -234,17 +244,16 @@
throw "Error when installing dependencies.." throw "Error when installing dependencies.."
fi fi
if get-zig; then if ! check-zig; then
# pen bold grey "Downloadet zig" get-zig
if check-path; then fi
if get-ly; then if get-ly; then
if build-ly; then if build-ly; then
line line
check "Installed ly successfully!" check "Installed ly successfully!"
fi fi
fi fi
fi
fi
;; ;;
*) *)
echo "$distro is not supported by this script!" echo "$distro is not supported by this script!"