Files
openclaw/scripts/docker/install-sh-common/version-parse.sh
2026-04-11 03:31:47 +01:00

25 lines
456 B
Bash

#!/usr/bin/env bash
extract_openclaw_semver() {
local raw="${1:-}"
local parsed=""
parsed="$(
printf '%s\n' "$raw" \
| tr -d '\r' \
| grep -Eo 'v?[0-9]+\.[0-9]+\.[0-9]+([.-][0-9A-Za-z]+(\.[0-9A-Za-z]+)*)?(\+[0-9A-Za-z.-]+)?' \
| head -n 1 \
|| true
)"
printf '%s' "${parsed#v}"
}
quiet_npm() {
npm \
--loglevel=error \
--no-update-notifier \
--no-fund \
--no-audit \
--no-progress \
"$@"
}