Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Robin Erich Muench
metaSNV
Commits
a580e728
Commit
a580e728
authored
Mar 16, 2017
by
Robin Erich Muench
Browse files
update metaSNP_NEW does not allow spaces
parent
0454b51a
Changes
1
Hide whitespace changes
Inline
Side-by-side
metaSNP_NEW
View file @
a580e728
...
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment