From 346f73a3037f05a131ecc264f63bd5ef55075fe2 Mon Sep 17 00:00:00 2001 From: lingtalfi Date: Sat, 3 Oct 2015 08:02:28 +0200 Subject: [PATCH 1/2] add function o for mac --- bashmarks.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/bashmarks.sh b/bashmarks.sh index b77a8c1..ae5a2e0 100644 --- a/bashmarks.sh +++ b/bashmarks.sh @@ -66,6 +66,20 @@ function g { fi } +# open bookmark in mac +function o { + check_help $1 + source $SDIRS + target="$(eval $(echo echo $(echo \$DIR_$1)))" + if [ -d "$target" ]; then + open "$target" + elif [ ! -n "$target" ]; then + echo -e "\033[${RED}WARNING: '${1}' bashmark does not exist\033[00m" + else + echo -e "\033[${RED}WARNING: '${target}' does not exist\033[00m" + fi +} + # print bookmark function p { check_help $1 From 5116540025b9a06fdafb6aaa4db7a621ccb434be Mon Sep 17 00:00:00 2001 From: lingtalfi Date: Sat, 3 Oct 2015 08:06:48 +0200 Subject: [PATCH 2/2] add help for o function --- bashmarks.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/bashmarks.sh b/bashmarks.sh index ae5a2e0..20f2e24 100644 --- a/bashmarks.sh +++ b/bashmarks.sh @@ -103,6 +103,7 @@ function check_help { echo '' echo 's - Saves the current directory as "bookmark_name"' echo 'g - Goes (cd) to the directory associated with "bookmark_name"' + echo 'o - Opens the directory associated with "bookmark_name" in Finder (MacOsX only)' echo 'p - Prints the directory associated with "bookmark_name"' echo 'd - Deletes the bookmark' echo 'l - Lists all available bookmarks'