add zpatch, a function to apply a patch file to cwd (lists files in $OHMYPATCHES)

This commit is contained in:
Aaron Bieber 2021-06-21 14:13:58 +00:00
parent aafbf3f101
commit 1916450d90
2 changed files with 12 additions and 1 deletions

View File

@ -1,5 +1,15 @@
zpatch() {
if [ -z $OHMYPATCHES ]; then
echo "please set OHMYPATCHES to the directory that contains your patches."
return 1
fi
local _patch_file="$(ls ${OHMYPATCHES}/* | fzf)"
/usr/bin/patch $@ < "${_patch_file}"
}
zh() {
fc -ln | eval `fzf`
fc -ln | eval $(fzf)
}
zpkg() {

View File

@ -5,5 +5,6 @@
|------+---------------------------------|
| zh | Interactive shell history. |
| zpkg | Interactive package add/remove. |
| zpatch | Interactive function for applying patches. |