-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·67 lines (56 loc) · 1.73 KB
/
install.sh
File metadata and controls
executable file
·67 lines (56 loc) · 1.73 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
60
61
62
63
64
65
66
67
#!/bin/bash
# WTF-Tools Installation Script
# Installs all WTF-Tools to make them available in your PATH
set -e
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color
INSTALL_DIR="$HOME/.local/bin"
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# List of all tools to install
TOOLS=(
"zombie-killer"
"guess-dependency-manager"
"postmortem"
"killport-plus"
"tail-highlight"
"latency-check"
"stash-manager"
"ssh-key-manager"
"build-cache-manager"
"book"
)
# Create installation directory if it doesn't exist
mkdir -p "$INSTALL_DIR"
# Check if installation directory is in PATH
if [[ ":$PATH:" != *":$INSTALL_DIR:"* ]]; then
echo -e "${YELLOW}Warning:${NC} $INSTALL_DIR is not in your PATH"
echo -e "Add the following line to your shell profile (~/.bashrc, ~/.zshrc, etc.):"
echo -e "${BLUE}export PATH=\"\$PATH:$INSTALL_DIR\"${NC}"
echo
fi
# Install each tool
echo -e "${BLUE}Installing WTF-Tools...${NC}"
for tool in "${TOOLS[@]}"; do
source_file="$SCRIPT_DIR/scripts/$tool.sh"
target_file="$INSTALL_DIR/$tool"
if [ -f "$source_file" ]; then
cp "$source_file" "$target_file"
chmod +x "$target_file"
echo -e "${GREEN}✓${NC} Installed $tool"
else
echo -e "${RED}✗${NC} Could not find $tool.sh"
fi
done
echo
echo -e "${GREEN}Installation complete!${NC}"
echo -e "You can now use the following commands:"
for tool in "${TOOLS[@]}"; do
echo -e " ${BLUE}$tool${NC}"
done
echo
echo -e "${YELLOW}Note:${NC} If this is your first time running these tools,"
echo -e "you may need to restart your terminal or run: ${BLUE}source ~/.bashrc${NC} (or your shell's config file)"