Files
openclaw/scripts/docker/install-sh-common/version-parse.sh
2026-04-23 18:44:26 +01:00

21 lines
402 B
Bash

#!/usr/bin/env bash
extract_openclaw_semver() {
local raw="${1:-}"
raw="${raw//$'\r'/}"
if [[ "$raw" =~ v?([0-9]+\.[0-9]+\.[0-9]+([.-][0-9A-Za-z]+(\.[0-9A-Za-z]+)*)?(\+[0-9A-Za-z.-]+)?) ]]; then
printf '%s' "${BASH_REMATCH[1]}"
fi
}
quiet_npm() {
npm \
--loglevel=error \
--logs-max=0 \
--no-update-notifier \
--no-fund \
--no-audit \
--no-progress \
"$@"
}