Fix libvips version sort

sort is ascending, so should take last entry, not first
This commit is contained in:
Aaron Kaluszka
2026-01-26 11:14:58 -08:00
committed by Juhyung Park
parent d1290be513
commit 1a324d8a6e

View File

@@ -177,7 +177,7 @@ cd $APP
# https://github.com/lovell/sharp/blob/main/src/common.h#L20
VIPS_LOCAL_VERSION="$(pkg-config --modversion vips || true)"
VIPS_TARGET_VERSION="8.17.3"
if [[ "$(printf '%s\n' $VIPS_TARGET_VERSION $VIPS_LOCAL_VERSION | sort -V | head -n1)" == "$VIPS_LOCAL_VERSION" ]]; then
if [[ "$(printf '%s\n' $VIPS_TARGET_VERSION $VIPS_LOCAL_VERSION | sort -V | tail -n1)" == "$VIPS_LOCAL_VERSION" ]]; then
echo "Local libvips-dev is installed, manually building sharp"
pnpm remove sharp
SHARP_FORCE_GLOBAL_LIBVIPS=1 npm_config_build_from_source=true pnpm add sharp --ignore-scripts=false --allow-build=sharp