Fix absolute paths in project. Separate -a logic into -a and -A

main
Ian Mancini 4 years ago
parent 7d6e36c352
commit 8b9e6c164b

@ -12,8 +12,10 @@ If there is at least 1 project path and this script is called without
arguments, it will launch fzf so you can select one. arguments, it will launch fzf so you can select one.
Options: Options:
-a [dir] Add a new project. Defaults to current dir -A Add current dir as a project
-a [dir] Add a new project.
-r Remove project from projects. (select with fzf) -r Remove project from projects. (select with fzf)
-f Change "finder" used to select the project
-l List projects -l List projects
-h Print this message -h Print this message
EOF EOF
@ -113,18 +115,11 @@ NEW_PROJECT_DIR=""
FINDER="fzf" FINDER="fzf"
# Parse args # Parse args
while getopts "f:hral" opt; do while getopts "f:hra:Al" opt; do
case $opt in case $opt in
f) FINDER=$OPTARG;; f) FINDER=$OPTARG;;
a) A) OPEN="false"; NEW_PROJECT_DIR=$(pwd); add_project ;;
OPEN="false" a) OPEN="false"; NEW_PROJECT_DIR=$(readlink -f "$OPTARG"); add_project ;;
if [ ! -z $OPTARG ]; then
NEW_PROJECT_DIR=$OPTARG
else
NEW_PROJECT_DIR=$(pwd)
fi
add_project
;;
r) OPEN="false"; remove_project ;; r) OPEN="false"; remove_project ;;
l) list_projects; exit 0 ;; l) list_projects; exit 0 ;;
h) OPEN="false"; help; exit 0 ;; h) OPEN="false"; help; exit 0 ;;

Loading…
Cancel
Save