many changes. rewritten mark, newproject, and goto in C. mark is 95% functional, with newproject and goto less so.

This commit is contained in:
Josh Ashton
2023-08-05 12:10:58 -06:00
parent c43e89cff3
commit b5136b661b
7 changed files with 225 additions and 4 deletions
Executable
+41
View File
@@ -0,0 +1,41 @@
#!/bin/zsh
# Dependencies:
# quaxlyqueen/scripts/mark
BOOKMARKS_FILE=~/.bookmarks
# Catch any invalid input.
if [[ $# -eq 0 || $# -gt 1 ]]; then
echo "\nImproper usage. Try:"
echo "\ngoto [keyword]"
echo " goto downloads"
echo " goto school"
echo " goto portfolio"
echo " goto -h"
echo " goto --help"
# Display help.
elif [[ $1 == "-h" || $1 == "--help" ]]; then
echo "\nImproper usage. Try:"
echo "\ngoto [keyword]"
echo " goto downloads"
echo " goto school"
echo " goto portfolio"
echo " goto -h"
echo " goto --help"
else
# Locate the bookmark.
if [ $(grep -c "$1" $BOOKMARKS_FILE) -gt 0 ]; then
# Go to the bookmark
cd $(grep "$1" $BOOKMARKS_FILE | head -n 1)
# List bookmarks if bookmark was not found.
else
echo "Bookmark not found. Available bookmarks:"
mark -ls
fi
fi