-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·34 lines (25 loc) · 899 Bytes
/
install.sh
File metadata and controls
executable file
·34 lines (25 loc) · 899 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
#!/bin/bash
# Install script for img
set -e
echo "Installing img..."
# Check if Rust is installed
if ! command -v cargo &> /dev/null; then
echo "Error: Rust/Cargo is not installed. Please install Rust first:"
echo "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh"
exit 1
fi
# Build the project in release mode
echo "Building img..."
cargo build --release
# Create local bin directory if it doesn't exist
mkdir -p ~/.local/bin
# Install the binary
echo "Installing binary to ~/.local/bin..."
cp target/release/img ~/.local/bin/
# Add to PATH if not already there
if [[ ":$PATH:" != *":$HOME/.local/bin:"* ]]; then
echo "Adding ~/.local/bin to PATH..."
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
echo "Please restart your shell or run 'source ~/.bashrc' to update PATH"
fi
echo "Installation complete! You can now run 'img' from anywhere."