-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmake_project.sh
56 lines (48 loc) · 921 Bytes
/
make_project.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/usr/bin/env bash
# Argument = -a argument -v
usage()
{
cat << EOF
usage: $0 -o OUTDIR [options]
This script creates a project directory structure
required arguments:
-o OUTDIR Output directory
options:
-h Show this message
-v Verbose
EOF
}
OUTDIR=
VERBOSE=
while getopts “o:hv” OPT
do
case $OPT in
o)
OUTDIR=$OPTARG
;;
h)
usage
exit 1
;;
v)
VERBOSE=1
;;
?)
usage
exit
;;
esac
done
if [[ -z $OUTDIR ]]
then
usage;
exit 1;
fi
ddata="$OUTDIR/data"
dbin="$OUTDIR/bin"
ddocs="$OUTDIR/docs"
dresults="$OUTDIR/results"
test ! -d "$ddata" && mkdir -p "$ddata"
test ! -d "$dbin" && mkdir -p "$dbin"
test ! -d "$ddocs" && mkdir -p "$ddocs"
test ! -d "$dresults" && mkdir -p "$dresults"