-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·43 lines (35 loc) · 1020 Bytes
/
install.sh
File metadata and controls
executable file
·43 lines (35 loc) · 1020 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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash
# Install script for Cmel interpreter
set -e
echo "🔨 Building and installing Cmel interpreter..."
# Navigate to the cmel directory
cd "$(dirname "$0")"
# Build the interpreter
echo "📦 Compiling Cmel..."
./build.sh
# Determine installation directory
INSTALL_DIR="/usr/local/bin"
# Check if we have write permissions
if [ -w "$INSTALL_DIR" ]; then
SUDO=""
else
SUDO="sudo"
echo "⚠️ Need sudo permissions to install to $INSTALL_DIR"
fi
# Install the binary
echo "📥 Installing cmel to $INSTALL_DIR..."
$SUDO cp cmel "$INSTALL_DIR/cmel"
$SUDO chmod +x "$INSTALL_DIR/cmel"
# Verify installation
if command -v cmel &> /dev/null; then
echo "✅ Cmel installed successfully!"
echo "📍 Location: $(which cmel)"
echo "🎉 You can now run 'cmel' from anywhere!"
echo ""
echo "Try it out:"
echo " cmel # Start REPL"
echo " cmel <file.cmel> # Run a Cmel file"
else
echo "❌ Installation failed. Please check permissions."
exit 1
fi