setup_env/sync.sh

30 lines
635 B
Bash
Executable File

#!/bin/bash
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
source "$SCRIPT_DIR/_lib.sh"
self_update() {
echo "Pulling latest setup_env..."
local before after
before=$(git -C "$SCRIPT_DIR" rev-parse HEAD)
git -C "$SCRIPT_DIR" pull
after=$(git -C "$SCRIPT_DIR" rev-parse HEAD)
if [ "$before" != "$after" ]; then
echo "sync.sh updated — re-running with latest version..."
exec "$0" "$@"
fi
}
main() {
self_update "$@"
deploy_configs
deploy_bin
bash "$SCRIPT_DIR/install_nvchad.sh"
deploy_nvim
echo ""
echo "Sync complete! Restart your shell or run 'source ~/.bashrc'."
}
main "$@"