#!/bin/sh
# Resolve symlinks to find real script location, then go up to package root
REAL="$(readlink -f "$0" 2>/dev/null || echo "$0")"
DIR="$(cd "$(dirname "$REAL")/.." && pwd)"
# Save caller's CWD before cd so init/git get the correct working directory
ORIG_CWD="$(pwd)"
cd "$DIR" && OPENSPE_PW_CWD="$ORIG_CWD" node dist/index.js "$@"
cd "$ORIG_CWD"
