Simplify add project function

main
Ian Mancini 4 years ago
parent a8c7a7d1ea
commit 8585be2072

@ -14,6 +14,7 @@ arguments, it will launch fzf so you can select one.
Options: Options:
-a [dir] Add a new project. Defaults to current dir -a [dir] Add a new project. Defaults to current dir
-r Remove project from projects. (select with fzf) -r Remove project from projects. (select with fzf)
-l List projects
-h Print this message -h Print this message
EOF EOF
} }
@ -38,7 +39,7 @@ add_project() {
exit 1 exit 1
fi fi
sed -i "$ a $NEW_PROJECT_DIR" "$PROJECTS_FILE" echo "$NEW_PROJECT_DIR" >> "$PROJECTS_FILE"
if [ $? == 0 ]; then if [ $? == 0 ]; then
echo "Info: added successfully" echo "Info: added successfully"
exit 0 exit 0

Loading…
Cancel
Save