Skip to content

Commit

Permalink
wget -> curl
Browse files Browse the repository at this point in the history
  • Loading branch information
JordanLaserGit committed Jan 22, 2024
1 parent 8afa2e1 commit 1afd20e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ If you'd like to run the stream, clone this repo and execute the command below.
```
/ngen-datastream/scripts/stream.sh /ngen-datastream/configs/conf_datastream_daily.json
```
requires `jq` and `wget`
requires `jq`

### Example `conf_datastream.json`
```
Expand Down
20 changes: 13 additions & 7 deletions scripts/stream.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ GEOPACKAGE_NGENRUN_PATH="${NGEN_CONFIG_PATH%/}/$GEOPACKGE_NGENRUN"

if [ -e "$RESOURCE_PATH" ]; then
if [[ $RESOURCE_PATH == *"https://"* ]]; then
wget -O $DATASTREAM_RESOURCES $RESOURCE_PATH
echo "curl'ing $DATASTREAM_RESOURCES $RESOURCE_PATH"
curl -# -L -o $DATASTREAM_RESOURCES $RESOURCE_PATH
if [[ $RESOURCE_PATH == *".tar."* ]]; then
tar -xzvf $(basename $RESOURCE_PATH)
fi
Expand All @@ -98,15 +99,20 @@ else
WEIGHTS_DEFAULT="https://ngenresourcesdev.s3.us-east-2.amazonaws.com/weights_conus_v21.json"
WEIGHTS_PATH="${DATASTREAM_RESOURCES%/}/weights_conus.json"

wget -O $GRID_FILE_PATH $GRID_FILE_DEFAULT
wget -O $NGEN_CONF_PATH $NGEN_CONF_DEFAULT
wget -O $NGEN_REAL_PATH $NGEN_REAL_DEFAULT
wget -O $WEIGHTS_PATH $WEIGHTS_DEFAULT
echo "curl'ing $GRID_FILE_PATH $GRID_FILE_DEFAULT"
curl -L -o $GRID_FILE_PATH $GRID_FILE_DEFAULT
echo "curl'ing $NGEN_CONF_PATH $NGEN_CONF_DEFAULT"
curl -L -o $NGEN_CONF_PATH $NGEN_CONF_DEFAULT
echo "curl'ing $NGEN_REAL_PATH $NGEN_REAL_DEFAULT"
curl -L -o $NGEN_REAL_PATH $NGEN_REAL_DEFAULT
echo "curl'ing $WEIGHTS_PATH $WEIGHTS_DEFAULT"
curl -L -o $WEIGHTS_PATH $WEIGHTS_DEFAULT

GEOPACKAGE="conus.gpkg"
GEOPACKAGE_DEFAULT="https://lynker-spatial.s3.amazonaws.com/v20.1/$GEOPACKAGE"
GEOPACKAGE_RESOURCES_PATH="${DATASTREAM_RESOURCES%/}/$GEOPACKAGE"
wget -O $GEOPACKAGE_RESOURCES_PATH $GEOPACKAGE_DEFAULT
echo "curl'ing $GEOPACKAGE_RESOURCES_PATH $GEOPACKAGE_DEFAULT"
curl -L -o $GEOPACKAGE_RESOURCES_PATH $GEOPACKAGE_DEFAULT

fi

Expand All @@ -127,7 +133,7 @@ else
if command -v "hfsubset" &>/dev/null; then
echo "hfsubset is installed and available in the system's PATH. Subsetting, now!"
else
wget -O "$DATASTREAM_RESOURCES/hfsubset-linux_amd64.tar.gz" https://github.com/LynkerIntel/hfsubset/releases/download/hfsubset-release-12/hfsubset-linux_amd64.tar.gz
curl -L -o "$DATASTREAM_RESOURCES/hfsubset-linux_amd64.tar.gz" https://github.com/LynkerIntel/hfsubset/releases/download/hfsubset-release-12/hfsubset-linux_amd64.tar.gz
tar -xzvf "$DATASTREAM_RESOURCES/hfsubset-linux_amd64.tar.gz"
fi

Expand Down

0 comments on commit 1afd20e

Please sign in to comment.