-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This script will make it easier for developers to spin up an environment. It may eventually be used by build processes as well.
- Loading branch information
Matt Stone
committed
Aug 26, 2022
1 parent
8315639
commit 9f8fd5b
Showing
5 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,7 @@ vendor.bundle.js | |
bundle.js.map | ||
dist/ | ||
yarn-error.log | ||
src/app/public/data | ||
|
||
# Bundled JS | ||
src/app/build | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
if [[ -n "${IOW_BOUNDARY_TOOL_DEBUG}" ]]; then | ||
set -x | ||
fi | ||
|
||
MUNICIPAL_BOUNDARIES_DATA_LOCATION="https://linc.osbm.nc.gov/explore/dataset/municipalities-2020/download/?format=geojson&lang=en" | ||
MUNICIPAL_BOUNDARIES_FILENAME=muni.geo.json | ||
DATA_DIR=src/app/public/data | ||
|
||
function usage() { | ||
echo -n \ | ||
"Usage: $(basename "$0") | ||
Execute Yarn CLI commands. | ||
" | ||
} | ||
|
||
function fetchData() { | ||
if [ ! -d "$DATA_DIR" ]; then | ||
mkdir -p "$DATA_DIR" | ||
fi | ||
|
||
echo "Fetching municipal data from: $MUNICIPAL_BOUNDARIES_DATA_LOCATION" | ||
curl "${MUNICIPAL_BOUNDARIES_DATA_LOCATION}" -o "$DATA_DIR/$MUNICIPAL_BOUNDARIES_FILENAME" | ||
} | ||
|
||
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then | ||
if [ "${1:-}" = "--help" ]; then | ||
usage | ||
else | ||
if [[ -f "$DATA_DIR/$MUNICIPAL_BOUNDARIES_FILENAME" ]]; then | ||
if [ "${1:-}" = "--force" ]; then | ||
echo "Warning: forcing data refetching!" | ||
rm "$DATA_DIR/$MUNICIPAL_BOUNDARIES_FILENAME" | ||
fetchData | ||
else | ||
echo "Skipping data fetching: file exists." | ||
fi | ||
else | ||
fetchData | ||
fi | ||
fi | ||
fi |
Empty file.