diff --git a/zet b/zet index f71d466..86c1c26 100755 --- a/zet +++ b/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"