mirror of
https://github.com/logos-messaging/logos-messaging-nim.git
synced 2026-01-02 05:53:11 +00:00
* Add foundry version in makefile and install scripts * revert to older verison of Anvil for rln tests and anvil_install fix * pin pnpm version to be installed as rln dep * source pnpm after new install * Add to github path * use npm to install pnpm for rln ci * Update foundry and pnpm versions in Makefile
38 lines
1.2 KiB
Bash
Executable File
38 lines
1.2 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
# Install pnpm
|
|
|
|
REQUIRED_PNPM_VERSION="$1"
|
|
|
|
if command -v pnpm &> /dev/null; then
|
|
# pnpm is already installed; check the current version.
|
|
CURRENT_PNPM_VERSION=$(pnpm --version 2>/dev/null)
|
|
|
|
if [ -n "$CURRENT_PNPM_VERSION" ]; then
|
|
# Compare CURRENT_PNPM_VERSION < REQUIRED_PNPM_VERSION using sort -V
|
|
lower_version=$(printf '%s\n%s\n' "$CURRENT_PNPM_VERSION" "$REQUIRED_PNPM_VERSION" | sort -V | head -n1)
|
|
|
|
if [ "$lower_version" != "$REQUIRED_PNPM_VERSION" ]; then
|
|
echo "pnpm is already installed with version $CURRENT_PNPM_VERSION, which is older than the required $REQUIRED_PNPM_VERSION. Please update pnpm manually if needed."
|
|
fi
|
|
fi
|
|
else
|
|
# Install pnpm using npm
|
|
if [ -n "$REQUIRED_PNPM_VERSION" ]; then
|
|
echo "Installing pnpm version $REQUIRED_PNPM_VERSION..."
|
|
npm install -g pnpm@$REQUIRED_PNPM_VERSION
|
|
else
|
|
echo "Installing latest pnpm..."
|
|
npm install -g pnpm
|
|
fi
|
|
|
|
# Verify pnpm was installed
|
|
if ! command -v pnpm >/dev/null 2>&1; then
|
|
echo "Error: pnpm installation failed"
|
|
exit 1
|
|
fi
|
|
|
|
echo "pnpm successfully installed: $(pnpm --version)"
|
|
fi
|
|
|