Skip to content

Commit 772168c

Browse files
Fixing typo
Fixing a typo of getopts command Reported-by: Zelalem Tesemma <zelalem.tesemma@ec.gc.ca> Signed-off-by: Kasra Keshavarz <kasra.keshavarz1@ucalgary.ca>
1 parent fbd2b1a commit 772168c

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

gsde/gsde.sh

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ short_usage() {
4646

4747

4848
# argument parsing using getopt - WORKS ONLY ON LINUX BY DEFAULT
49-
parsedArguments=$(getopt -a -n gsde -o i:o:v:r:s:e:l:n:f:F:t:a:u:q:p:c:L: --long dataset-dir:,output-dir:,variable:,crs:,start-date:,end-date:,lat-lims:,lon-lims:,shape-file:,fid:,print-geotiff:,stat:,include-na:,quantile:,prefix:,cache:lib-path: -- "$@")
49+
parsedArguments=$(getopt -a -n gsde -o i:o:v:r:s:e:l:n:f:F:t:a:u:q:p:c:L: --long dataset-dir:,output-dir:,variable:,crs:,start-date:,end-date:,lat-lims:,lon-lims:,shape-file:,fid:,print-geotiff:,stat:,include-na:,quantile:,prefix:,cache:,lib-path: -- "$@")
5050
validArguments=$?
5151
if [ "$validArguments" != "0" ]; then
5252
short_usage;
@@ -67,19 +67,19 @@ do
6767
-i | --dataset-dir) geotiffDir="$2" ; shift 2 ;; # required
6868
-o | --output-dir) outputDir="$2" ; shift 2 ;; # required
6969
-v | --variable) variables="$2" ; shift 2 ;; # required
70-
-r | --crs) crs="$2" ; shift 2 ;; # required
70+
-r | --crs) crs="$2" ; shift 2 ;; # required
7171
-s | --start-date) startDate="$2" ; shift 2 ;; # redundant - added for compatibility
7272
-e | --end-date) endDate="$2" ; shift 2 ;; # redundant - added for compatibility
7373
-l | --lat-lims) latLims="$2" ; shift 2 ;; # required - could be redundant
7474
-n | --lon-lims) lonLims="$2" ; shift 2 ;; # required - could be redundant
7575
-f | --shape-file) shapefile="$2" ; shift 2 ;; # required - could be redundant
7676
-F | --fid) fid="$2" ; shift 2 ;; # required
7777
-t | --print-geotiff) printGeotiff="$2" ; shift 2 ;; # required
78-
-a | --stat) stats="$2" ; shift 2 ;; # optional
78+
-a | --stat) stats="$2" ; shift 2 ;; # optional
7979
-u | --include-na) includeNA="$2" ; shift 2 ;; # required
80-
-q | --quantile) quantiles="$2" ; shift 2 ;; # optional
81-
-p | --prefix) prefix="$2" ; shift 2 ;; # optional
82-
-c | --cache) cache="$2" ; shift 2 ;; # required
80+
-q | --quantile) quantiles="$2" ; shift 2 ;; # optional
81+
-p | --prefix) prefix="$2" ; shift 2 ;; # optional
82+
-c | --cache) cache="$2" ; shift 2 ;; # required
8383
-L | --lib-path) renvCache="$2" ; shift 2 ;; # required
8484

8585
# -- means the end of the arguments; drop this, and break out of the while loop
@@ -280,16 +280,16 @@ if [[ -n "$shapefile" ]] && [[ -n $stats ]]; then
280280
for var in "${variablesMod[@]}"; do
281281
## build renv and create stats
282282
Rscript "$(dirname $0)/../assets/stats.R" \
283-
"$tempInstallPath" \
284-
"$exactextractrCache" \
285-
"$renvPackagePath" \
286-
"$virtualEnvPath" \
287-
"$virtualEnvPath" \
288-
"${virtualEnvPath}/renv.lock" \
289-
"${cache}/${var}.nc" \
290-
"$shapefile" \
291-
"$outputDir/${prefix}stats_${var}.csv" \
292-
"$stats" \
283+
"$tempInstallPath" \
284+
"$exactextractrCache" \
285+
"$renvPackagePath" \
286+
"$virtualEnvPath" \
287+
"$virtualEnvPath" \
288+
"${virtualEnvPath}/renv.lock" \
289+
"${cache}/${var}.nc" \
290+
"$shapefile" \
291+
"$outputDir/${prefix}stats_${var}.csv" \
292+
"$stats" \
293293
"$includeNA" \
294294
"$quantiles" \
295295
"$fid" >> "${outputDir}/${prefix}stats_${var}.log" 2>&1;

0 commit comments

Comments
 (0)