-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap.sh
More file actions
executable file
Β·59 lines (47 loc) Β· 1.54 KB
/
bootstrap.sh
File metadata and controls
executable file
Β·59 lines (47 loc) Β· 1.54 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
#!/bin/bash
set -e
echo "π Bootstrapping rext-core development environment..."
# Function to check if a command exists
command_exists() {
command -v "$1" >/dev/null 2>&1
}
# Check if Rust is installed
if ! command_exists cargo; 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
echo "β
Rust/Cargo found"
# Check if git-cliff is installed
if ! command_exists git-cliff; then
echo "π¦ Installing git-cliff..."
cargo install git-cliff
if [ $? -ne 0 ]; then
echo "β Failed to install git-cliff"
exit 1
fi
echo "β
git-cliff installed successfully"
else
echo "β
git-cliff found"
fi
# Set up pre-commit hook
if [ -f "hooks/pre-commit" ]; then
echo "π Setting up pre-commit hook..."
# Create .git/hooks directory if it doesn't exist
mkdir -p .git/hooks
# Copy the pre-commit hook
cp hooks/pre-commit .git/hooks/pre-commit
# Make it executable
chmod +x .git/hooks/pre-commit
echo "β
Pre-commit hook installed"
else
echo "β οΈ Warning: hooks/pre-commit file not found"
fi
echo ""
echo "π Bootstrap complete! You can now:"
echo " β’ Run 'cargo build' to build the project"
echo " β’ Run 'cargo test' to run tests"
echo " β’ Run 'git-cliff -o CLIFF_CHANGELOG.md' to generate a cliff changelog"
echo " β’ Make commits and the pre-commit hook will run automatically"
echo ""
echo "π See CONTRIBUTING.md for detailed contribution guidelines"