Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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()