Commit a580e728 authored by Robin Erich Muench's avatar Robin Erich Muench
Browse files

update metaSNP_NEW does not allow spaces

parent 0454b51a
......@@ -9,6 +9,8 @@
# Copyright (c) 2016 Robin Munch
# Licenced under the GNU General Public License (see LICENSE)
# Abort on any errors
set -e
# Variables
PROJECT_NAME="$1"
......@@ -27,30 +29,45 @@ required_parameter() {
exit 1
}
make_dir(){
echo >&2 ""
echo >&2 " Project name is available. New project directory created here: $PROJECT_NAME"
echo >&2 ""
mkdir -p $PROJECT_NAME/{cov,bestsplits,snpCaller,filtered/{pop,ind},distances}
echo >&2 " Project name is available. New project directory created here: '$1'"
echo >&2 ""
mkdir -p "$1/"{cov,bestsplits,snpCaller,filtered/{pop,ind},distances}
}
file_exists(){
echo >&2 ""
echo >&2 " ERROR: The directory '$PROJECT_NAME' exists. Please choose a unique project name."
echo >&2 " ERROR: The directory '$1' exists. Please choose a unique project name."
echo >&2 ""
}
filename_space(){
echo >&2 ""
echo >&2 " ERROR: The directory name '$1' contains spaces. Please choose a project name without spaces!"
echo >&2 ""
exit
}
# Check required parameters
[ -n "$PROJECT_NAME" ] || required_parameter "project_name"
# Make
# Make directory
if [ ! -d "$PROJECT_NAME" ]
then
make_dir
case "$PROJECT_NAME" in
*\ * )
filename_space "$PROJECT_NAME"
;;
*)
make_dir "$PROJECT_NAME"
;;
esac
else
file_exists
file_exists "$PROJECT_NAME"
fi
exit
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment