|
1 |
| -#!/usr/bin/env bash |
| 1 | +#/usr/bin/env bash |
2 | 2 | #
|
3 | 3 | # windows-install.sh
|
4 | 4 | #
|
|
79 | 79 | # (3) Parse the usage information (default usage file name: current file's name with -usage appended).
|
80 | 80 | # (4) Parse the command line using the usage information.
|
81 | 81 |
|
82 |
| -starting_directory=${PWD} |
83 |
| - |
84 | 82 | ### Start of boilerplate -- do not edit this block #######################
|
85 | 83 | export OPENCOARRAYS_SRC_DIR="${OPENCOARRAYS_SRC_DIR:-${PWD%/}}"
|
86 | 84 | if [[ ! -f "${OPENCOARRAYS_SRC_DIR}/src/libcaf.h" ]]; then
|
@@ -246,34 +244,33 @@ else
|
246 | 244 | sudo apt-get install mpich
|
247 | 245 | fi
|
248 | 246 |
|
249 |
| - # Install OpenCoarrays |
250 |
| - |
251 |
| - |
252 |
| -set_SUDO_if_needed_to_write_to_install_dir() |
253 |
| -{ |
254 |
| - info "Checking whether the directory ${install_prefix} exists... " |
255 |
| - if [[ -d "${install_prefix}" ]]; then |
256 |
| - info "yes" |
257 |
| - info "Checking whether I have write permissions to ${install_prefix} ... " |
258 |
| - if [[ -w "${install_prefix}" ]]; then |
| 247 | + set_SUDO_if_needed_to_write_to_install_dir() |
| 248 | + { |
| 249 | + info "Checking whether the directory ${install_prefix} exists... " |
| 250 | + if [[ -d "${install_prefix}" ]]; then |
259 | 251 | info "yes"
|
| 252 | + info "Checking whether I have write permissions to ${install_prefix} ... " |
| 253 | + if [[ -w "${install_prefix}" ]]; then |
| 254 | + info "yes" |
| 255 | + else |
| 256 | + info "no" |
| 257 | + SUDO="sudo" |
| 258 | + fi |
260 | 259 | else
|
261 | 260 | info "no"
|
262 |
| - SUDO="sudo" |
263 |
| - fi |
264 |
| - else |
265 |
| - info "no" |
266 |
| - info "Checking whether I can create ${install_prefix} ... " |
267 |
| - if mkdir -p "${install_prefix}" >& /dev/null; then |
268 |
| - info "yes." |
269 |
| - else |
270 |
| - info "no." |
271 |
| - SUDO="sudo" |
| 261 | + info "Checking whether I can create ${install_prefix} ... " |
| 262 | + if mkdir -p "${install_prefix}" >& /dev/null; then |
| 263 | + info "yes." |
| 264 | + else |
| 265 | + info "no." |
| 266 | + SUDO="sudo" |
| 267 | + fi |
272 | 268 | fi
|
273 |
| - fi |
274 |
| -} |
275 |
| -set_SUDO_if_needed_to_write_to_install_dir |
| 269 | + } |
| 270 | + set_SUDO_if_needed_to_write_to_install_dir |
276 | 271 |
|
| 272 | + # Install OpenCoarrays |
| 273 | + |
277 | 274 | if [[ -d "$build_path" ]]; then
|
278 | 275 | rm -rf "$build_path"
|
279 | 276 | fi
|
|
0 commit comments