-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·72 lines (61 loc) · 1.85 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·72 lines (61 loc) · 1.85 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/bin/bash
set -e
BINARY_URL="https://github.com/ChasmHQ/chasm/releases/download/pre-release/chasm"
INSTALL_DIR="/usr/local/bin"
BINARY_NAME="chasm"
echo "Chasm Installer"
echo "==============="
echo ""
# Check if running on macOS
if [[ "$OSTYPE" != "darwin"* ]]; then
echo "Error: This installer is for macOS only"
exit 1
fi
# Check if Foundry is installed
if ! command -v forge &> /dev/null; then
echo "Warning: Foundry is not installed. Chasm requires Foundry (anvil, cast, forge)."
echo "Install Foundry from: https://getfoundry.sh"
echo ""
read -p "Continue installation anyway? (y/N) " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
exit 1
fi
fi
# Create temporary directory
TMP_DIR=$(mktemp -d)
TMP_FILE="$TMP_DIR/$BINARY_NAME"
echo "Downloading Chasm binary..."
if ! curl -L --progress-bar "$BINARY_URL" -o "$TMP_FILE"; then
echo "Error: Failed to download binary"
rm -rf "$TMP_DIR"
exit 1
fi
echo "Making binary executable..."
chmod +x "$TMP_FILE"
# Check if we need sudo for installation
if [ -w "$INSTALL_DIR" ]; then
echo "Installing to $INSTALL_DIR/$BINARY_NAME..."
mv "$TMP_FILE" "$INSTALL_DIR/$BINARY_NAME"
else
echo "Installing to $INSTALL_DIR/$BINARY_NAME (requires sudo)..."
sudo mv "$TMP_FILE" "$INSTALL_DIR/$BINARY_NAME"
fi
# Cleanup
rm -rf "$TMP_DIR"
# Verify installation
if command -v chasm &> /dev/null; then
echo ""
echo "✓ Chasm installed successfully!"
echo ""
echo "Usage:"
echo " chasm . # Run in current directory"
echo " chasm ./contracts # Run in specific directory"
echo ""
echo "The web UI will be available at http://localhost:3000"
else
echo ""
echo "Error: Installation completed but 'chasm' command not found in PATH"
echo "You may need to add $INSTALL_DIR to your PATH or restart your terminal"
exit 1
fi