Adds automatic symlink detection
This commit is contained in:
parent
2710c15850
commit
9c0d6169ec
4 changed files with 55 additions and 6 deletions
|
|
@ -1,3 +1,5 @@
|
|||
#!/bin/env sh
|
||||
|
||||
yay -S --needed yazi p7zip jq poppler fd ripgrep fzf zoxide imagemagick
|
||||
yay -S --needed yazi p7zip jq poppler fd ripgrep fzf zoxide imagemagick fuse-archive zip
|
||||
|
||||
ya pack --install
|
||||
|
|
|
|||
2
.config/yadm/config
Normal file
2
.config/yadm/config
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
[yadm]
|
||||
auto-alt = false
|
||||
28
.config/yadm/hooks/pre_commit
Executable file
28
.config/yadm/hooks/pre_commit
Executable file
|
|
@ -0,0 +1,28 @@
|
|||
#!/bin/env sh
|
||||
|
||||
foundSymlinks=false
|
||||
|
||||
for file in $(yadm diff --name-only --cached); do
|
||||
lsResult=$(ls -1 -l "$file")
|
||||
if [[ $lsResult != *"->"* ]]; then
|
||||
break
|
||||
fi
|
||||
|
||||
symlinkTarget=$(echo "$lsResult" | awk '{print $NF}')
|
||||
|
||||
if [[ $lsResult != *"##"* ]]; then
|
||||
break
|
||||
fi
|
||||
|
||||
echo "$file is a YADM symlink. Telling git to ignore it..."
|
||||
|
||||
yadm restore --staged "$file"
|
||||
echo "$file" >>~/.gitignore
|
||||
|
||||
foundSymlinks=true
|
||||
done
|
||||
|
||||
if [ $foundSymlinks ]; then
|
||||
echo "Symlinks found. Adding .gitignore to commit..."
|
||||
yadm add ~/.gitignore
|
||||
fi
|
||||
27
.gitignore
vendored
27
.gitignore
vendored
|
|
@ -1,6 +1,23 @@
|
|||
# Symlinks
|
||||
~\.config\hypr\config\Monitors.conf
|
||||
.config\hypr\config\WorkspaceRules.conf
|
||||
.config\hypr\config\settings\Input.conf
|
||||
/*
|
||||
!/.gitignore
|
||||
|
||||
*.key
|
||||
!/.config/
|
||||
/.config/*
|
||||
|
||||
# yazi
|
||||
!/.config/yazi/
|
||||
/.config/yazi/plugins/*
|
||||
|
||||
!/.config/hypr/
|
||||
!/.config/ghostty/
|
||||
!/.config/nvim/
|
||||
!/.config/yadm/
|
||||
!/.config/waybar/
|
||||
!/.config/evremap/
|
||||
|
||||
# DO NOT EDIT ANYTHING PAST HERE!
|
||||
# Scripts automatically add entries here
|
||||
.config/hypr/config/Monitors.conf
|
||||
.config/hypr/config/WorkspaceRules.conf
|
||||
.config/hypr/config/settings/Input.conf
|
||||
.config/waybar/Output.config.json
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue