diff --git a/changelog/@unreleased/pr-23.v2.yml b/changelog/@unreleased/pr-23.v2.yml new file mode 100644 index 00000000..e54a7c86 --- /dev/null +++ b/changelog/@unreleased/pr-23.v2.yml @@ -0,0 +1,5 @@ +type: fix +fix: + description: Remove yq from script + links: + - https://github.com/palantir/foundry-platform-python/pull/23 diff --git a/scripts/generate_sdk.sh b/scripts/generate_sdk.sh index ecac24fd..e7a0ed80 100755 --- a/scripts/generate_sdk.sh +++ b/scripts/generate_sdk.sh @@ -5,6 +5,7 @@ EXCLUDED_PATHS=( "Makefile" "scripts/generate_sdk.sh" "scripts/generate_spec.sh" + "scripts/parse_version.py" "config.json" ".policy.yml" "changelog" diff --git a/scripts/generate_spec.sh b/scripts/generate_spec.sh index 89ad5eda..9a625882 100755 --- a/scripts/generate_spec.sh +++ b/scripts/generate_spec.sh @@ -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}" diff --git a/scripts/parse_version.py b/scripts/parse_version.py new file mode 100644 index 00000000..2c87edec --- /dev/null +++ b/scripts/parse_version.py @@ -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()