add zpatch, a function to apply a patch file to cwd (lists files in $OHMYPATCHES)
This commit is contained in:
parent
aafbf3f101
commit
1916450d90
@ -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() {
|
zh() {
|
||||||
fc -ln | eval `fzf`
|
fc -ln | eval $(fzf)
|
||||||
}
|
}
|
||||||
|
|
||||||
zpkg() {
|
zpkg() {
|
||||||
|
@ -5,5 +5,6 @@
|
|||||||
|------+---------------------------------|
|
|------+---------------------------------|
|
||||||
| zh | Interactive shell history. |
|
| zh | Interactive shell history. |
|
||||||
| zpkg | Interactive package add/remove. |
|
| zpkg | Interactive package add/remove. |
|
||||||
|
| zpatch | Interactive function for applying patches. |
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user