-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmake_analysis_auto_config.sh
More file actions
39 lines (34 loc) · 1.08 KB
/
make_analysis_auto_config.sh
File metadata and controls
39 lines (34 loc) · 1.08 KB
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
#!/bin/bash
autoscript_dir="/projectnb/siggers/data/callen_project/test_pipeline/scripts/"
set_gpr_dir() {
read -p "Please specify the root directory of gpr files: `echo $'\n> '`" gpr_dir
if [ ! -d "${gpr_dir}" ]; then
printf "${gpr_dir} does not exist. Try again, or make the directory.\n"
return 1
else
echo "OK. setting gpr directory[GPR_DIR] as ${gpr_dir} "
export GPR_DIR="${autoscript_dir}${gpr_dir}"
source_file="${autoscript_dir}sourcefile.sh"
touch "${source_file}"
echo "export GPR_DIR='${gpr_dir}'">>${source_file}
source ${source_file}
return 0
fi
}
confirm_gpr_dir() {
read -p "Are you sure you want to set ${gpr_dir} as your gpr directory(yes/no)?" gpr_confirm
case ${gpr_confirm,,} in
y|yes)
echo "OK. Setting gpr directory as $gpr_dir for this session"
export GPR_DIR="${gpr_dir}"
return 1
;;
n|no)
echo "Exiting make_analysis_auto_config without setting gpr directory"
return 1
;;
*) echo "Please enter y[yes] or n[no]"
return 0
esac
}
until set_gpr_dir; do : ; source "${autoscript_dir}sourcefile.sh"; done