-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathremote-install.sh
More file actions
executable file
·26 lines (19 loc) · 873 Bytes
/
Copy pathremote-install.sh
File metadata and controls
executable file
·26 lines (19 loc) · 873 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/bash
set -euo pipefail
# Specwright remote installer
# Usage: curl -fsSL https://raw.githubusercontent.com/ranjith-src/specwright/main/remote-install.sh | bash
# Or: curl -fsSL https://raw.githubusercontent.com/ranjith-src/specwright/main/remote-install.sh | bash -s /path/to/project
TARGET_DIR="${1:-.}"
TMP_DIR=$(mktemp -d)
REPO_URL="https://github.com/ranjith-src/specwright/archive/refs/heads/main.tar.gz"
cleanup() { rm -rf "$TMP_DIR"; }
trap cleanup EXIT
echo "Downloading Specwright..."
curl -fsSL "$REPO_URL" | tar xz -C "$TMP_DIR"
# GitHub tarballs extract to repo-branch/ directory
EXTRACTED=$(find "$TMP_DIR" -mindepth 1 -maxdepth 1 -type d | head -1)
if [ -z "$EXTRACTED" ] || [ ! -f "$EXTRACTED/install.sh" ]; then
echo "Error: Failed to download Specwright. Check the repository URL."
exit 1
fi
bash "$EXTRACTED/install.sh" "$TARGET_DIR"