Auto commit: 2024-11-07 16:40:21
This commit is contained in:
parent
ee9331e5de
commit
fe34f614e8
1 changed files with 23 additions and 0 deletions
23
.config/yadm/auto.sh
Executable file
23
.config/yadm/auto.sh
Executable file
|
@ -0,0 +1,23 @@
|
|||
# Add individual files, ignoring symlinks
|
||||
[ ! -L "$HOME/.zshrc" ] && yadm add "$HOME/.zshrc"
|
||||
|
||||
# Directory navigation
|
||||
cd "$HOME/.config/" || exit
|
||||
|
||||
# List of config directories/files to add
|
||||
# TODO: add these to a text file instead and read from it for easy appending
|
||||
# could add a yadm alias to append stuff to this file?
|
||||
configs=(nvim btop dunst i3 kitty lazygit nushell polybar rofi tmux wal zathura starship.toml yadm)
|
||||
|
||||
# Loop through each item in configs array
|
||||
for config in "${configs[@]}"; do
|
||||
# Check if it's not a symlink before adding
|
||||
# [ ! -L "$config" ] && [ -n "$(find "$config" -type l)" ] && yadm add "$config"
|
||||
find "$config" -type f -exec yadm add {} +
|
||||
done
|
||||
|
||||
# Commit and push if there are changes
|
||||
if [[ -n $(yadm status --porcelain) ]]; then
|
||||
yadm commit -m "Auto commit: $(date +'%Y-%m-%d %H:%M:%S')"
|
||||
yadm push
|
||||
fi
|
Loading…
Add table
Add a link
Reference in a new issue