-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.zsh
More file actions
executable file
·56 lines (45 loc) · 1.65 KB
/
Copy pathinstall.zsh
File metadata and controls
executable file
·56 lines (45 loc) · 1.65 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
echo "🔧 Setting up your dotfiles..."
# ----------------------------------------
# ensure custom path directories exist
# ----------------------------------------
mkdir -p "$HOME/scripts" "$HOME/bin"
echo "📂 Verified directories exist: ~/scripts and ~/bin"
# ----------------------------------------
# symlink zshrc and zprofile
# ----------------------------------------
files=( ".zshrc" ".zprofile" )
for i in "${files[@]}"; do
ln -sf "$(pwd)/$i" ~/"$i"
echo "🔗 Symlinked $i to ~/$i"
done
# ----------------------------------------
# create base gitconfig if missing
# ----------------------------------------
if [ ! -f ~/.gitconfig ]; then
cat <<EOF > ~/.gitconfig
[include]
path = ~/dotfiles/.gitconfig
EOF
echo "✅ Created base ~/.gitconfig and included ~/dotfiles/.gitconfig"
else
echo "⚠️ gitconfig already exists skipping creation"
fi
# ----------------------------------------
# copy gitignore global if missing
# ----------------------------------------
if [ ! -f ~/.gitignore_global ]; then
cp "$(pwd)/.gitignore_global" ~/.gitignore_global
echo "✅ Copied default gitignore global from dotfiles"
else
echo "⚠️ gitignore global already exists compare manually with $(pwd)/.gitignore_global"
fi
# ----------------------------------------
# set git global excludesfile if missing
# ----------------------------------------
if ! git config --global core.excludesfile &>/dev/null; then
git config --global core.excludesfile ~/.gitignore_global
echo "✅ Set git global core excludesfile to ~/.gitignore_global"
else
echo "ℹ️ git global core excludesfile is already set"
fi
echo "🎉 Dotfiles setup complete"