somratpro commited on
Commit
c591c73
Β·
1 Parent(s): c083fd1

feat: update startup banner to display bundled runtime version instead of tag

Browse files
Files changed (1) hide show
  1. start.sh +19 -2
start.sh CHANGED
@@ -7,6 +7,8 @@ set -e
7
 
8
  # ── Startup Banner ──
9
  OPENCLAW_VERSION="${OPENCLAW_VERSION:-latest}"
 
 
10
  WHATSAPP_ENABLED="${WHATSAPP_ENABLED:-false}"
11
  WHATSAPP_ENABLED_NORMALIZED=$(printf '%s' "$WHATSAPP_ENABLED" | tr '[:upper:]' '[:lower:]')
12
  SYNC_INTERVAL="${SYNC_INTERVAL:-180}"
@@ -30,10 +32,25 @@ fi
30
  if [ -n "$ERRORS" ]; then
31
  echo "Missing required secrets:"
32
  echo -e "$ERRORS"
33
- echo "Add them in HF Spaces β†’ Settings β†’ Secrets"
34
  exit 1
35
  fi
36
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
  # ── Set LLM env based on model name ──
38
 
39
  # Auto-correct Gemini models to use google/ prefix if anthropic/ was mistakenly used
@@ -385,7 +402,7 @@ echo ""
385
  echo " β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”"
386
  echo " β”‚ πŸ“‹ Configuration Summary β”‚"
387
  echo " β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€"
388
- printf " β”‚ %-40s β”‚\n" "OpenClaw: $OPENCLAW_VERSION"
389
  printf " β”‚ %-40s β”‚\n" "Model: $LLM_MODEL"
390
  if [ -n "$TELEGRAM_BOT_TOKEN" ]; then
391
  printf " β”‚ %-40s β”‚\n" "Telegram: βœ… enabled"
 
7
 
8
  # ── Startup Banner ──
9
  OPENCLAW_VERSION="${OPENCLAW_VERSION:-latest}"
10
+ OPENCLAW_APP_DIR="/home/node/.openclaw/openclaw-app"
11
+ OPENCLAW_RUNTIME_VERSION=""
12
  WHATSAPP_ENABLED="${WHATSAPP_ENABLED:-false}"
13
  WHATSAPP_ENABLED_NORMALIZED=$(printf '%s' "$WHATSAPP_ENABLED" | tr '[:upper:]' '[:lower:]')
14
  SYNC_INTERVAL="${SYNC_INTERVAL:-180}"
 
32
  if [ -n "$ERRORS" ]; then
33
  echo "Missing required secrets:"
34
  echo -e "$ERRORS"
35
+ echo "Add them in HF Spaces β†’ Settings β†’ Secrets"
36
  exit 1
37
  fi
38
 
39
+ # Resolve the actual bundled OpenClaw version so the banner reflects what is
40
+ # inside the image, not just the requested tag.
41
+ if [ -f "$OPENCLAW_APP_DIR/package.json" ]; then
42
+ OPENCLAW_RUNTIME_VERSION=$(node -p "require('$OPENCLAW_APP_DIR/package.json').version" 2>/dev/null || true)
43
+ fi
44
+
45
+ if [ -n "$OPENCLAW_RUNTIME_VERSION" ]; then
46
+ OPENCLAW_DISPLAY_VERSION="$OPENCLAW_RUNTIME_VERSION"
47
+ if [ "$OPENCLAW_VERSION" != "$OPENCLAW_RUNTIME_VERSION" ]; then
48
+ OPENCLAW_DISPLAY_VERSION="$OPENCLAW_RUNTIME_VERSION (tag: $OPENCLAW_VERSION)"
49
+ fi
50
+ else
51
+ OPENCLAW_DISPLAY_VERSION="$OPENCLAW_VERSION"
52
+ fi
53
+
54
  # ── Set LLM env based on model name ──
55
 
56
  # Auto-correct Gemini models to use google/ prefix if anthropic/ was mistakenly used
 
402
  echo " β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”"
403
  echo " β”‚ πŸ“‹ Configuration Summary β”‚"
404
  echo " β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€"
405
+ printf " β”‚ %-40s β”‚\n" "OpenClaw: $OPENCLAW_DISPLAY_VERSION"
406
  printf " β”‚ %-40s β”‚\n" "Model: $LLM_MODEL"
407
  if [ -n "$TELEGRAM_BOT_TOKEN" ]; then
408
  printf " β”‚ %-40s β”‚\n" "Telegram: βœ… enabled"