@@ -8,7 +8,7 @@ function check_repo() {
88
99 if [ -d ${repo_name} ] ; then
1010 read -p " Delete the existing ${repo_name} directory and all contents? (y/n) " -n 1 -r
11- if [[ ${ REPLY} =~ ^[Yy]$ ]] ; then
11+ if [[ $REPLY =~ ^[Yy]$ ]] ; then
1212 rm -rf ${repo_name}
1313 fi
1414 fi
@@ -36,15 +36,15 @@ function build_moab {
3636 make install
3737
3838 echo " if [ -n \"\$ {LD_LIBRARY_PATH-}\" ]" >> ~ /.bashrc
39- echo " then" >> ~ /.bashrc >> ~ /.bashrc
39+ echo " then" >> ~ /.bashrc
4040 echo " export LD_LIBRARY_PATH=${install_dir} /moab/lib:\$ LD_LIBRARY_PATH" >> ~ /.bashrc
4141 echo " else" >> ~ /.bashrc
4242 echo " export LD_LIBRARY_PATH=${install_dir} /moab/lib" >> ~ /.bashrc
4343 echo " fi" >> ~ /.bashrc
4444
4545 PYTHON_VERSION=$( python -c ' import sys; print(sys.version.split(' ' )[0][0:3])' )
4646 echo " if [ -n \"\$ {PYTHONPATH-}\" ]" >> ~ /.bashrc
47- echo " then" >> ~ /.bashrc >> ~ /.bashrc
47+ echo " then" >> ~ /.bashrc
4848 echo " export PYTHONPATH=${install_dir} /moab/lib/python${PYTHON_VERSION} /site-packages:\$ PYTHONPATH" >> ~ /.bashrc
4949 echo " else" >> ~ /.bashrc
5050 echo " export PYTHONPATH=${install_dir} /moab/lib/python${PYTHON_VERSION} /site-packages" >> ~ /.bashrc
@@ -80,7 +80,7 @@ function install_pyne {
8080 cd pyne
8181 if [ $1 == ' stable' ] ; then
8282 TAG=$( git describe --abbrev=0 --tags)
83- git checkout tags/` echo $TAG ` -b ` echo $TAG `
83+ git checkout tags/` echo ${ TAG} ` -b ` echo ${ TAG} `
8484 fi
8585
8686
@@ -94,39 +94,40 @@ function install_pyne {
9494
9595 PYTHON_VERSION=$( python -c ' import sys; print(sys.version.split(' ' )[0][0:3])' )
9696 echo " if [ -n \"\$ {PYTHONPATH-}\" ]" >> ~ /.bashrc
97- echo " then" >> ~ /.bashrc >> ~ /.bashrc
97+ echo " then" >> ~ /.bashrc
9898 echo " export PYTHONPATH=~/.local/lib/python${PYTHON_VERSION} /site-packages:\$ PYTHONPATH" >> ~ /.bashrc
9999 echo " else" >> ~ /.bashrc
100100 echo " export PYTHONPATH=~/.local/lib/python${PYTHON_VERSION} /site-packages" >> ~ /.bashrc
101101 echo " fi" >> ~ /.bashrc
102+ source ~ /.bashrc
102103}
103104
104105function run_nuc_data_make {
105106
106107 cd
107- source ~ /.bashrc
108108 # Generate nuclear data file
109109 nuc_data_make
110110
111111}
112112
113113function test_pyne {
114114
115- source ~ /.bashrc
116115 cd $install_dir /pyne
117116 cd tests
118117
119118 ./travis-run-tests.sh python3
120119}
121120
121+ set -euo pipefail
122+ IFS=$' \n\t '
122123
123124# system update
124125eval brew update
125126eval brew install ${brew_package_list}
126127export PATH=" ${HOME} /.local/bin:${PATH} "
127128eval sudo pip3 install ${pip_package_list}
128129
129- nstall_dir =${HOME} /opt
130+ install_dir =${HOME} /opt
130131mkdir -p ${install_dir}
131132
132133build_moab
@@ -137,7 +138,7 @@ install_pyne $1
137138
138139run_nuc_data_make
139140
140- test_pyne $1
141+ test_pyne
141142
142143echo " Run 'source ~/.bashrc' to update environment variables. PyNE may not function correctly without doing so."
143- echo " PyNE build complete. PyNE can be rebuilt with the alias 'build_pyne' executed from $install_dir /pyne "
144+ echo " PyNE build complete."
0 commit comments