-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·59 lines (48 loc) · 1.31 KB
/
setup.sh
File metadata and controls
executable file
·59 lines (48 loc) · 1.31 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
# Git Workers Setup Script
echo "Setting up Git Workers..."
# Build the project
echo "Building the project..."
cargo build --release
# Get the absolute path to the binary
BINARY_PATH="$(pwd)/target/release/gw"
SHELL_FUNCTION_PATH="$(pwd)/shell/gw.sh"
echo "Binary built at: $BINARY_PATH"
# Detect shell
if [[ "$SHELL" == *"zsh"* ]]; then
SHELL_CONFIG="$HOME/.zshrc"
echo "Detected zsh shell"
elif [[ "$SHELL" == *"bash"* ]]; then
SHELL_CONFIG="$HOME/.bashrc"
echo "Detected bash shell"
else
echo "Unknown shell: $SHELL"
echo "Please manually add the following to your shell configuration:"
echo ""
echo "# Git Workers"
echo "export PATH=\"\$PATH:$(pwd)/target/release\""
echo "source $(pwd)/shell/gw.sh"
exit 1
fi
# Check if already configured
if grep -q "git-workers" "$SHELL_CONFIG" 2>/dev/null; then
echo "Git Workers already configured in $SHELL_CONFIG"
else
echo "Adding Git Workers to $SHELL_CONFIG..."
cat >> "$SHELL_CONFIG" << EOF
# Git Workers
export PATH="\$PATH:$(pwd)/target/release"
source $(pwd)/shell/gw.sh
EOF
echo "Configuration added to $SHELL_CONFIG"
fi
echo ""
echo "Setup complete!"
echo ""
echo "To activate, run:"
echo " source $SHELL_CONFIG"
echo ""
echo "Or restart your terminal."
echo ""
echo "Then test with:"
echo " gw"