Skip to content

Commit

Permalink
Correct asset redirect generation shell script
Browse files Browse the repository at this point in the history
  • Loading branch information
nikitawootten-nist committed Sep 22, 2023
1 parent d5eac0b commit 2f8177f
Showing 1 changed file with 4 additions and 19 deletions.
23 changes: 4 additions & 19 deletions support/generate_release_assets_redirect.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,25 +41,10 @@ function cleanup() {
}
trap cleanup EXIT

# Populate ROOT_METASCHEMAS with all metaschema basenames (oscal_catalog ... etc.)
# The find block:
# 1. Finds all files in the scratch directory's src/metaschema directory that match *_metaschema.xml
# 2. Exclude non-root metaschemas ("common" and "metadata" metaschemas)
# 3. Strip the path, leaving just the filename
# 4. Strip the "_metaschema.xml" suffix, leaving just "oscal_$name"
ROOT_METASCHEMAS=()
while IFS='' read -r metaschema; do
ROOT_METASCHEMAS+=("$metaschema")
done < <(find "${SCRATCH_DIR}/src/metaschema" \
-name '*_metaschema.xml' \
-a ! -name '*common*' \
-a ! -name '*metadata*' \
-exec basename {} _metaschema.xml ';')

ARTIFACTS=()
while IFS='' read -r asset; do
ARTIFACTS+=("$asset")
done < <(make -C "${SCRATCH_DIR}/build" list-release-artifacts)
ASSETS=()
for asset in $(make -sC "${SCRATCH_DIR}/build" list-release-artifacts); do
ASSETS+=("$asset")
done

OUTPUT_PATH=release-assets/latest
GH_RELEASES_URL=https://github.com/usnistgov/OSCAL/releases
Expand Down

0 comments on commit 2f8177f

Please sign in to comment.