-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·53 lines (42 loc) · 1.3 KB
/
install.sh
File metadata and controls
executable file
·53 lines (42 loc) · 1.3 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
#!/bin/bash
# Peck Package Manager Installation Script
set -e # Exit immediately if a command exits with a non-zero status
PROJECT_ROOT=$(dirname "$0")
cd "$PROJECT_ROOT"
echo "--- Building Peck Package Manager ---"
# Create and navigate to the build directory
mkdir -p build
cd build
# Run CMake
echo "Running CMake..."
cmake ..
# Build the project
echo "Building Peck..."
make -j$(nproc) # Use all available CPU cores for faster compilation
echo "Build complete. Executable 'peck' is in the build/ directory."
# Installation prompt
echo -e "\n--- Install Peck ---"
read -p "Do you want to install 'peck' to /usr/local/bin? (requires sudo, y/N): " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
echo "Installing 'peck' to /usr/local/bin..."
sudo cp peck /usr/local/bin/
echo "'peck' installed successfully. You can now run 'peck' from anywhere."
else
echo "Skipping installation to /usr/local/bin. You can run './build/peck' directly."
fi
# Cleanup prompt
echo -e "\n--- Cleanup ---"
read -p "Do you want to remove the build directory? (y/N): " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
echo "Removing build directory..."
cd .. # Go back to project root
rm -rf build
echo "Build directory removed."
else
echo "Keeping build directory."
fi
echo -e "\nPeck installation script finished."