Skip to content

Commit

Permalink
Remove yq from script (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsmith authored Sep 18, 2024
1 parent 6a67343 commit 507de3c
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 1 deletion.
5 changes: 5 additions & 0 deletions changelog/@unreleased/pr-23.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type: fix
fix:
description: Remove yq from script
links:
- https://github.com/palantir/foundry-platform-python/pull/23
1 change: 1 addition & 0 deletions scripts/generate_sdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ EXCLUDED_PATHS=(
"Makefile"
"scripts/generate_sdk.sh"
"scripts/generate_spec.sh"
"scripts/parse_version.py"
"config.json"
".policy.yml"
"changelog"
Expand Down
2 changes: 1 addition & 1 deletion scripts/generate_spec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ MAVEN_REPO_PATH="$MAVEN_DIST_RELEASE/$(echo "$MAVEN_CONJURE_GROUP_ID" | sed 's/\

mkdir -p $TMP_DIR
API_GATEWAY_VERSION=$( wget -q -O - "${MAVEN_REPO_PATH}/maven-metadata.xml" | \
yq -p xml -r '.metadata.versioning.release' )
python scripts/parse_version.py )

echo Downloading $API_GATEWAY_VERSION...
mkdir -p "${TMP_DIR}"
Expand Down
19 changes: 19 additions & 0 deletions scripts/parse_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import sys
import xml.etree.ElementTree as ET


def main():
xml_data = sys.stdin.read()
root = ET.fromstring(xml_data)

# Navigate to the 'release' element under 'metadata/versioning'
release = root.find(".//versioning/release")

if release is None:
raise Exception("Unable to find version")

print(release.text)


if __name__ == "__main__":
main()

0 comments on commit 507de3c

Please sign in to comment.