woocommerce/.github/actions/setup-woocommerce-monorepo/scripts/read-pnpm-version.sh

10 lines
182 B
Bash
Raw Normal View History

2023-12-18 07:31:49 +00:00
#!/usr/bin/env bash
PACKAGE_FILE=$1
if [[ -z "$PACKAGE_FILE" ]]; then
echo "Usage: $0 <package.json>"
exit 1
fi
awk -F'"' '/"pnpm": ".+"/{ print $4; exit; }' $PACKAGE_FILE