Skip to content

Commit

Permalink
Add script to update SPDX license list
Browse files Browse the repository at this point in the history
Signed-off-by: nscuro <[email protected]>
  • Loading branch information
nscuro committed Sep 1, 2023
1 parent 15a9baa commit 173d876
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
17 changes: 17 additions & 0 deletions dev/scripts/update-spdx-license-list.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash

set -euxo pipefail

SCRIPT_DIR="$(cd -P -- "$(dirname "$0")" && pwd -P)"
LICENSE_LIST_DATA_DIR="$(cd -P -- "${SCRIPT_DIR}/../../src/main/resources/license-list-data" && pwd -P)"
TMP_DOWNLOAD_FILE="$(mktemp)"

gh -R spdx/license-list-data release download "v$1" \
--archive tar.gz --clobber --output "${TMP_DOWNLOAD_FILE}"

rm -rf "${LICENSE_LIST_DATA_DIR}/json"

tar -xvzf "${TMP_DOWNLOAD_FILE}" \
--strip-components "1" \
--directory "${LICENSE_LIST_DATA_DIR}" \
"license-list-data-$1/json"
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public void testLoadDefaultLicenses() throws Exception {
Method method = generator.getClass().getDeclaredMethod("loadDefaultLicenses");
method.setAccessible(true);
method.invoke(generator);
Assert.assertEquals(489, qm.getAllLicensesConcise().size());
Assert.assertEquals(627, qm.getAllLicensesConcise().size());
}

@Test
Expand Down

0 comments on commit 173d876

Please sign in to comment.