Skip to content

Commit 8395024

Browse files
committed
feat(scripts): add install-scripts.sh for easy script distribution
Add helper script to copy template maintenance scripts to other MCP server repositories with validation and proper permissions. Features: - Validates target is an MCP repository - Copies all maintenance scripts - Sets executable permissions - Simple one-command installation
1 parent d6eaa9e commit 8395024

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

scripts/install-scripts.sh

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#!/bin/bash
2+
set -e
3+
4+
# Script to install merge scripts into a derived MCP repository
5+
# Usage: ./install-scripts.sh <target-repository-path>
6+
7+
# Color codes
8+
RED='\033[0;31m'
9+
GREEN='\033[0;32m'
10+
YELLOW='\033[1;33m'
11+
NC='\033[0m'
12+
13+
if [ $# -ne 1 ]; then
14+
echo "Usage: $0 <target-repository-path>"
15+
echo "Example: $0 ../../mcp-wayback-machine"
16+
exit 1
17+
fi
18+
19+
TARGET_PATH="$1"
20+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
21+
22+
# Validate target
23+
if [ ! -d "$TARGET_PATH" ]; then
24+
echo -e "${RED}Error: Target directory does not exist: $TARGET_PATH${NC}"
25+
exit 1
26+
fi
27+
28+
if [ ! -f "$TARGET_PATH/package.json" ]; then
29+
echo -e "${RED}Error: Target doesn't appear to be an MCP repository (no package.json found)${NC}"
30+
exit 1
31+
fi
32+
33+
# Create scripts directory in target
34+
echo -e "${YELLOW}Installing scripts to: $TARGET_PATH/scripts${NC}"
35+
mkdir -p "$TARGET_PATH/scripts"
36+
37+
# Copy scripts
38+
cp "$SCRIPT_DIR/merge-template-updates.sh" "$TARGET_PATH/scripts/"
39+
cp "$SCRIPT_DIR/analyze-template-diff.sh" "$TARGET_PATH/scripts/"
40+
cp "$SCRIPT_DIR/README.md" "$TARGET_PATH/scripts/"
41+
42+
# Make scripts executable
43+
chmod +x "$TARGET_PATH/scripts/merge-template-updates.sh"
44+
chmod +x "$TARGET_PATH/scripts/analyze-template-diff.sh"
45+
46+
echo -e "${GREEN}Scripts installed successfully!${NC}"
47+
echo ""
48+
echo "Available scripts in $TARGET_PATH:"
49+
echo " - scripts/merge-template-updates.sh (merge template changes)"
50+
echo " - scripts/analyze-template-diff.sh (analyze differences)"
51+
echo ""
52+
echo "See scripts/README.md for usage instructions."

0 commit comments

Comments
 (0)