Allow for easily editing or deleting the last zet
This commit is contained in:
parent
f46f956d58
commit
2dadf7ce1f
1 changed files with 10 additions and 2 deletions
12
zet
12
zet
|
@ -40,7 +40,11 @@ commit_changes() {
|
|||
delete_zet() {
|
||||
query="$1"
|
||||
|
||||
file="${ZET_DIR}/${query}/index.adoc"
|
||||
if [[ "$1" == "last" ]]; then
|
||||
file="$(find "$ZET_DIR" -type f -name "index.adoc" | sort | tail -1)"
|
||||
else
|
||||
file="${ZET_DIR}/${query}/index.adoc"
|
||||
fi
|
||||
|
||||
if [[ -f "$file" ]]; then
|
||||
run_git_command rm -rf "$file"
|
||||
|
@ -75,7 +79,11 @@ delete_zet() {
|
|||
edit_zet() {
|
||||
query="$1"
|
||||
|
||||
file="${ZET_DIR}/${query}/index.adoc"
|
||||
if [[ "$1" == "last" ]]; then
|
||||
file="$(find "$ZET_DIR" -type f -name "index.adoc" | sort | tail -1)"
|
||||
else
|
||||
file="${ZET_DIR}/${query}/index.adoc"
|
||||
fi
|
||||
|
||||
if [[ -f "$file" ]]; then
|
||||
"$EDITOR" "$file"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue