Skip to content

Commit

Permalink
make cdp . work without dataset
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Nov 15, 2020
1 parent 70137ca commit f56de93
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion bioinfoconda/lib/bash/bash_utils
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,14 @@ function cdp
elif [ $1 == "." ]; then
if extract_prj $PWD > /dev/null; then
cur_prj=`extract_prj $PWD`
cd $prj_root/$cur_prj/dataset
if [ -d "$prj_root/$cur_prj/dataset" ]; then
main_dir="$prj_root/$cur_prj/dataset"
elif [[ $(find $prj_root/$cur_prj -maxdepth 2 -type f,l -name Snakefile | head -n 1) != "" ]]; then
main_dir=$(dirname $(find $prj_root/$cur_prj -maxdepth 2 -type f,l -name Snakefile | head -n 1))
else
main_dir="$prj_root/$cur_prj"
fi
cd $main_dir
else
cd $prj_root
fi
Expand Down

0 comments on commit f56de93

Please sign in to comment.