From 9bb70cb13dffd95f9f003ee13a75b7aebbf06c22 Mon Sep 17 00:00:00 2001 From: Erick Hitter <git-contrib@ethitter.com> Date: Sun, 14 Apr 2019 13:34:59 -0700 Subject: [PATCH] Trigger static-asset cleanup by ensuring directory exists, even when empty --- scripts/deploy.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/deploy.sh b/scripts/deploy.sh index b97421b..9f42b58 100644 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -8,7 +8,7 @@ set -eo # Provide a basic version identifier, particularly since this script # is usually accessed via CDN. -echo "ℹ︎ WP-ORG-PLUGIN-DEPLOY VERSION: 2019041402" +echo "ℹ︎ WP-ORG-PLUGIN-DEPLOY VERSION: 2019041403" if [[ -z "$CI" ]]; then echo "ð˜…︎ Script is only to be run by GitLab CI" 1>&2 @@ -43,6 +43,12 @@ if [[ -z "$WP_ORG_ASSETS_DIR" ]]; then WP_ORG_ASSETS_DIR=".wordpress-org" fi +# Create empty static-assets directory if needed, triggering +# removal of any stray assets in svn. +if [[ ! -d "${CI_PROJECT_DIR}/${WP_ORG_ASSETS_DIR}/" ]]; then + mkdir -p "${CI_PROJECT_DIR}/${WP_ORG_ASSETS_DIR}/" +fi + echo "ℹ︎ PLUGIN_SLUG: ${PLUGIN_SLUG}" echo "ℹ︎ PLUGIN_VERSION: ${PLUGIN_VERSION}" echo "ℹ︎ WP_ORG_RELEASE_REF: ${WP_ORG_RELEASE_REF}" -- GitLab