diff --git a/README.md b/README.md index c9061bb..c0d93cf 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,7 @@ for more info. parsed for ignore and externals will not have localization keywords replaced. - *ignore* - *plain-copy* +- *license-output* - *changelog-title* - *manual-changelog* - *move-folders* diff --git a/release.sh b/release.sh index 4253dcd..1e22364 100755 --- a/release.sh +++ b/release.sh @@ -810,6 +810,7 @@ changelog= changelog_markup="text" enable_nolib_creation= ignore= +license= unchanged= zip_root_dirs=() nolib_exclude= @@ -915,6 +916,9 @@ if [ -f "$pkgmeta_file" ]; then split="true" fi ;; + license-output) + license=$yaml_value + ;; manual-changelog) changelog=$yaml_value manual_changelog="true" @@ -2355,6 +2359,24 @@ else end_group "changelog" fi +### +### Create a license if not present and .pkgmeta requests one. +### + +if [[ -n "$license" && ! -f "$topdir/$license" && -n "$slug" ]]; then + start_group "Saving license as $license" "license" + # curseforge.com is protected by cloudflare, but wowace.com isn't? >.> + if license_text=$( curl -sf --retry 3 --retry-delay 10 "https://www.wowace.com/project/$slug/license" 2>/dev/null ); then + # text is wrapped with \n\n
\n\t\t ... \n\t
\n