diff --git a/README.md b/README.md index 88a7069..e8e2cc6 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,10 @@ You can also use a few directives for WoWInterface uploading. be used instead if set in the .pkgmeta. - *wowi-convert-changelog* : `yes|no` (defaults to yes) Convert a manual changelog in Markdown format to BBCode if you have [pandoc](http://pandoc.org/) - installed; otherwise, the manual changelog will be used as-is. + installed; otherwise, the manual changelog will be used as-is. If set to `no` + when using a generated changelog, Markdown will be used instead of BBCode. + **Note**: Markdown support is experimental and needs to be requested on a + per-project basis. ### String replacements diff --git a/release.sh b/release.sh index b153044..4cc5028 100755 --- a/release.sh +++ b/release.sh @@ -56,6 +56,8 @@ game_type= file_type= file_name="{package-name}-{project-version}{nolib}{classic}" +wowi_markup="bbcode" + ## END USER OPTIONS if [[ ${BASH_VERSINFO[0]} -lt 4 ]] || [[ ${BASH_VERSINFO[0]} -eq 4 && ${BASH_VERSINFO[1]} -lt 3 ]]; then @@ -1903,6 +1905,10 @@ else changelog="CHANGELOG.md" changelog_markup="markdown" + if [ -n "$wowi_gen_changelog" ] && [ -z "$wowi_convert_changelog" ]; then + wowi_markup="markdown" + fi + start_group "Generating changelog of commits into $changelog" "changelog" _changelog_range= @@ -1974,7 +1980,7 @@ else # WoWI uses BBCode, generate something usable to post to the site # the file is deleted on successful upload - if [ -n "$addonid" ] && [ -n "$tag" ] && [ -n "$wowi_gen_changelog" ]; then + if [ -n "$addonid" ] && [ -n "$tag" ] && [ -n "$wowi_gen_changelog" ] && [ "$wowi_markup" = "bbcode" ]; then wowi_changelog="$releasedir/WOWI-$project_version-CHANGELOG.txt" cat <<- EOF | line_ending_filter > "$wowi_changelog" [size=5]${project}[/size] @@ -2016,7 +2022,7 @@ else # WoWI uses BBCode, generate something usable to post to the site # the file is deleted on successful upload - if [ -n "$addonid" ] && [ -n "$tag" ] && [ -n "$wowi_gen_changelog" ]; then + if [ -n "$addonid" ] && [ -n "$tag" ] && [ -n "$wowi_gen_changelog" ] && [ "$wowi_markup" = "bbcode" ]; then wowi_changelog="$releasedir/WOWI-$project_version-CHANGELOG.txt" cat <<- EOF | line_ending_filter > "$wowi_changelog" [size=5]${project}[/size] @@ -2052,7 +2058,7 @@ else # WoWI uses BBCode, generate something usable to post to the site # the file is deleted on successful upload - if [ -n "$addonid" ] && [ -n "$tag" ] && [ -n "$wowi_gen_changelog" ]; then + if [ -n "$addonid" ] && [ -n "$tag" ] && [ -n "$wowi_gen_changelog" ] && [ "$wowi_markup" = "bbcode" ]; then wowi_changelog="$releasedir/WOWI-$project_version-CHANGELOG.txt" cat <<- EOF | line_ending_filter > "$wowi_changelog" [size=5]${project}[/size] @@ -2357,7 +2363,7 @@ if [ -z "$skip_zipfile" ]; then _wowi_args=() if [ -f "$wowi_changelog" ]; then _wowi_args+=("-F changelog=<$wowi_changelog") - elif [ -n "$manual_changelog" ]; then + elif [ -n "$manual_changelog" ] || [ "$wowi_markup" = "markdown" ]; then _wowi_args+=("-F changelog=<$pkgdir/$changelog") fi if [ -z "$wowi_archive" ]; then @@ -2379,7 +2385,7 @@ if [ -z "$skip_zipfile" ]; then case $result in 202) echo "Success!" - rm -f "$wowi_changelog" 2>/dev/null + [ -f "$wowi_changelog" ] && rm -f "$wowi_changelog" 2>/dev/null ;; 401) echo "Error! No addon for id \"$addonid\" found or you do not have permission to upload files."