forked from mathiasbynens/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbootstrap.sh
More file actions
executable file
·42 lines (38 loc) · 1.2 KB
/
bootstrap.sh
File metadata and controls
executable file
·42 lines (38 loc) · 1.2 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
#!/usr/bin/env bash
cd "$(dirname "${BASH_SOURCE}")";
git pull origin master;
function doIt() {
rsync --exclude ".git/" \
--exclude ".claude/settings.local.json" \
--exclude ".DS_Store" \
--exclude ".osx" \
--exclude "bootstrap.sh" \
--exclude "README.md" \
--exclude "LICENSE-MIT.txt" \
--exclude "Brewfile" \
-avh --no-perms . ~;
if [ ! -f ~/.claude/CLAUDE.local.md ]; then
mkdir -p ~/.claude;
printf '# Machine-local memory (generated by bootstrap.sh, edit freely)\n\nTerminal: %s (TERM=%s), OS: %s%s%s\n' \
"${TERM_PROGRAM:-unknown}" "${TERM:-unknown}" "$(uname -s)" \
"${WSL_DISTRO_NAME:+, WSL: $WSL_DISTRO_NAME}" \
"${TMUX:+, tmux}" > ~/.claude/CLAUDE.local.md;
fi;
source ~/.zshrc;
echo "";
echo "Next steps on a new machine:";
echo " brew bundle — install Brewfile packages";
echo " gpg --full-generate-key — generate GPG key for commit signing";
echo " bash init/mackup.sh — restore app settings from ~/.config/Mackup/";
}
if [ "$1" = "--force" -o "$1" = "-f" ]; then
doIt;
else
printf "This may overwrite existing files in your home directory. Are you sure? (y/n) ";
read REPLY;
echo "";
if [[ $REPLY =~ ^[Yy]$ ]]; then
doIt;
fi;
fi;
unset doIt;