-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·57 lines (45 loc) · 1.69 KB
/
install.sh
File metadata and controls
executable file
·57 lines (45 loc) · 1.69 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
#!/bin/bash
# One-liner installation script for chezmoi-sqlrsync
set -euo pipefail
REPO_URL="https://github.com/pnwmatt/chezmoi-sqlrsyncn"
BRANCH="main"
# Check if chezmoi is installed
if ! command -v chezmoi &> /dev/null; then
echo "Error: chezmoi is not installed. Please install chezmoi first."
echo "Visit: https://chezmoi.io/install/"
exit 1
fi
# Get chezmoi source directory
CHEZMOI_SOURCE_DIR=$(chezmoi source-path)
if [[ ! -d "$CHEZMOI_SOURCE_DIR" ]]; then
echo "Error: Chezmoi source directory not found: $CHEZMOI_SOURCE_DIR"
echo "Run 'chezmoi init' first."
exit 1
fi
echo "Installing SQLRsync integration to: $CHEZMOI_SOURCE_DIR"
# Create temporary directory
TEMP_DIR=$(mktemp -d)
trap 'rm -rf "$TEMP_DIR"' EXIT
# Download and extract
echo "Downloading from $REPO_URL..."
curl -sSL "${REPO_URL}/archive/${BRANCH}.tar.gz" | tar -xz -C "$TEMP_DIR"
EXTRACTED_DIR="$TEMP_DIR/chezmoi-sqlrsync-${BRANCH}"
# Copy files
echo "Installing scripts..."
mkdir -p "$CHEZMOI_SOURCE_DIR/scripts/lib"
cp -r "$EXTRACTED_DIR/scripts/"* "$CHEZMOI_SOURCE_DIR/scripts/"
echo "Installing templates..."
mkdir -p "$CHEZMOI_SOURCE_DIR/templates"
cp -r "$EXTRACTED_DIR/templates/"* "$CHEZMOI_SOURCE_DIR/templates/" 2>/dev/null || true
echo "Installing documentation..."
mkdir -p "$CHEZMOI_SOURCE_DIR/docs"
cp -r "$EXTRACTED_DIR/docs/"* "$CHEZMOI_SOURCE_DIR/docs/" 2>/dev/null || true
echo ""
echo "✅ SQLRsync integration installed successfully!"
echo ""
echo "Next steps:"
echo "1. Add SQLRsync configuration to your .chezmoi.toml.tmpl"
echo "2. See examples in: $CHEZMOI_SOURCE_DIR/templates/chezmoi.toml.example"
echo "3. Run: chezmoi apply"
echo ""
echo "Documentation available in: $CHEZMOI_SOURCE_DIR/docs/"