add chlg, chcode warning for --watch w/o file

This commit is contained in:
2024-10-28 17:18:28 -05:00
parent 8742fd36a3
commit 417dafe751
+14
View File
@@ -32,7 +32,21 @@ function gi() { curl -sL https://www.toptal.com/developers/gitignore/api/$@ ;}
function chcode() {
EDITOR="code --wait"
# If no arguments are provided, the chezmoi directory is opened
if [[ "$@" == *"--watch"* ]]; then
for arg in "$@"; do
if [[ ! $arg == -* ]]; then
chezmoi edit $@
return
fi
done
echo "--watch requires a file to be provided, directories aren't supported with watch mode"
fi
chezmoi edit $@
}
function chlg() {
lazygit --path ~/.local/share/chezmoi
}
# Add an "alert" alias for long running commands. Use like so: