diff --git a/bin/.bin/project-management/project b/bin/.bin/project-management/project index ce7f8d59..7ecd3029 100755 --- a/bin/.bin/project-management/project +++ b/bin/.bin/project-management/project @@ -3,7 +3,7 @@ # This script sets things based on my current project and will set the symlink ~/Projects/current to the correct folder # GLOBAL VARIABLES -export PROJECTS_PATH="$HOME/Projects" +export PROJECTS_PATH="$HOME/1Projects" export SYMLINC="$PROJECTS_PATH/current" function print_subcommand_details(){ diff --git a/bin/.bin/project-management/project-list b/bin/.bin/project-management/project-list index 74eff8fe..59860adf 100755 --- a/bin/.bin/project-management/project-list +++ b/bin/.bin/project-management/project-list @@ -10,7 +10,10 @@ function list_projects(){ fi echo "--new" fi - find "$PROJECTS_PATH/" -maxdepth 1 -mindepth 1 -type d | xargs -L 1 basename + find "$PROJECTS_PATH/" -maxdepth 2 -mindepth 2 -type d | while read line; do + echo "$line" | tr '/' '\n' | tac | head -n 2 | tac | tr '\n' '/' + echo + done } function print_help(){ diff --git a/bin/.bin/project-management/project-note b/bin/.bin/project-management/project-note new file mode 100644 index 00000000..f1f641af --- /dev/null +++ b/bin/.bin/project-management/project-note @@ -0,0 +1 @@ +#!/usr/bin/env bash diff --git a/bin/.bin/project-management/project-switch b/bin/.bin/project-management/project-switch index c0d9df92..09a2ae41 100755 --- a/bin/.bin/project-management/project-switch +++ b/bin/.bin/project-management/project-switch @@ -13,8 +13,12 @@ function print_help(){ function auto_switch(){ local switchto if echo "$PWD" | grep -q "$PROJECTS_PATH"; then - switchto=$( echo "$PWD" | sed "s#$PROJECTS_PATH/##") - switchto="${switchto%/*}" + switchto="$( echo "$PWD" | sed "s#$PROJECTS_PATH/##")" + switchto="$(echo "$switchto" | cut -d '/' -f 1,2)" + if [[ "$switchto" != *'/'* ]]; then + echo "no /" + switchto="--unset" + fi if [[ "$PWD" == "$PROJECTS_PATH" ]]; then switchto="--unset" fi