Skip to content

Commit

Permalink
Fix syntax error in entrypoint.sh (#30)
Browse files Browse the repository at this point in the history
Co-authored-by: Frank Greguska <[email protected]>
  • Loading branch information
frankinspace and Frank Greguska authored Apr 3, 2024
1 parent 3ad4eab commit 31663c5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Deprecated
### Removed
### Fixed
- [issues/29](https://github.com/podaac/cmr-umm-updater/issues/29) Fix syntax error in entrypoint.sh
### Security

## [0.7.0]
Expand Down
11 changes: 6 additions & 5 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,19 @@ disable_removal=$6
umm_type=$7
use_associations=${8:-true}
umm_version=$9
url_value=$10
url_value=${10}

# Replace version placeholder with actual version
jq --arg a $version '.Version = $a' "$file" > "cmr/cmr.json"
jq --arg a "$version" '.Version = $a' "$file" > "cmr/cmr.json"

if [[ -n "${url_value}"]]
if [[ $url_value ]]; then
jq --arg a "${url_value}" '.URL.URLValue = $a' cmr/cmr.json > cmr/cmr.json.tmp && mv cmr/cmr.json.tmp cmr/cmr.json
jq --arg a "${url_value}" '.URL.URLValue = $a' cmr/cmr.json > cmr/cmr.json.tmp
mv cmr/cmr.json.tmp cmr/cmr.json
else
# Replace Harmony URL placeholder with Harmony URL based on env
if [[ $env == "sit" || $env == "uat" ]]; then
jq --arg a "https://harmony.uat.earthdata.nasa.gov" '.URL.URLValue = $a' cmr/cmr.json > cmr/cmr.json.tmp && mv cmr/cmr.json.tmp cmr/cmr.json
jq --arg a "https://harmony.uat.earthdata.nasa.gov" '.URL.URLValue = $a' cmr/cmr.json > cmr/cmr.json.tmp
mv cmr/cmr.json.tmp cmr/cmr.json
fi
fi

Expand Down

0 comments on commit 31663c5

Please sign in to comment.