blob: 699cce6654d6aef9e9d0993552ffb9c0db3df69e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
#!/bin/bash
# this should be on remote server
CONF_FILE="/home/git/public_repos.conf"
REPO_NAME=$(basename $(pwd) .git)
PUBLIC_DIR="/var/www/git/$REPO_NAME"
if grep -qx "$REPO_NAME" "$CONF_FILE"; then
echo "Syncing $REPO_NAME to public directory..."
rsync -a --delete --exclude '.git' /home/git/$REPO_NAME/ "$PUBLIC_DIR/"
echo "Public sync complete."
else
echo "$REPO_NAME is not marked as public. No action taken."
fi
|