clone

a browser-first diagram editor with live svg previews, local drafts and encrypted, accountless sharing

chore: add -y flag to release.sh to skip the interactive confirmation

Dami committed 8847c5d
commit
8847c5d8e8bea5a0a9ff055adeecc50d2cee218c
parent
d2db1a821449d2e9c2425bdfafac6db205d2620a
author
Dami <dami.etoile@gmail.com>
1 file changed, +12 -5
Mrelease.sh17++++++++++++-----
M release.sh +12 -5
@@ -5,14 +5,16 @@ set -Eeuo pipefail
55 ROOT="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)"66 CHECK_ONLY=false77 ALLOW_DIRTY=false8+ASSUME_YES=false89 PHASE="initialization"910 1011 usage() {1112 cat <<'EOF'12-Usage: ./release.sh [--check] [--allow-dirty]13+Usage: ./release.sh [--check] [--allow-dirty] [-y]1314 1415 --check Run the local gate without Cloudflare authentication or deployment.1516 --allow-dirty Permit a dirty worktree in --check mode only.17+ -y, --yes Skip the interactive production confirmation.1618 EOF1719 }1820
@@ -36,6 +38,7 @@ while (($#)); do
3638 case "$1" in3739 --check) CHECK_ONLY=true ;;3840 --allow-dirty) ALLOW_DIRTY=true ;;41+ -y|--yes) ASSUME_YES=true ;;3942 -h|--help) usage; exit 0 ;;4043 *) usage >&2; die "unknown option: $1" ;;4144 esac
@@ -210,10 +213,14 @@ section 'Cloudflare authentication and remote preflight'
210213 run_in "$ROOT/renderers/edge" "$WRANGLER" whoami211214 run_in "$ROOT/services/api" "$ROOT/services/api/node_modules/.bin/wrangler" d1 migrations list diagramzip --remote --config wrangler.jsonc212215 213-[[ -t 0 ]] || die 'production confirmation requires an interactive terminal.'214-printf '\nDeploy %s to production across %s Cloudflare deployments? [y/N] ' "$RELEASE_SHORT_SHA" "$DEPLOYMENT_COUNT"215-read -r answer216-[[ "$answer" == y || "$answer" == Y ]] || die 'production release cancelled.'216+if [[ "$ASSUME_YES" == true ]]; then217+ printf '\nDeploying %s to production across %s Cloudflare deployments (-y).\n' "$RELEASE_SHORT_SHA" "$DEPLOYMENT_COUNT"218+else219+ [[ -t 0 ]] || die 'production confirmation requires an interactive terminal; pass -y to skip it.'220+ printf '\nDeploy %s to production across %s Cloudflare deployments? [y/N] ' "$RELEASE_SHORT_SHA" "$DEPLOYMENT_COUNT"221+ read -r answer222+ [[ "$answer" == y || "$answer" == Y ]] || die 'production release cancelled.'223+fi217224 218225 export DIAGRAMZIP_RELEASE_MESSAGE="$RELEASE_MESSAGE"219226