_scripts/push-env-to-vercel.sh#!/usr/bin/env bashset -euo pipefail# Push env vars from .env.production to Vercel using REST API upsert (encrypted)# Usage:# npm run env# npm run env:prod# npm run env:prevTARGETS_CSV="${1:-production}" # development,preview,production (comma-separated)ENV_FILE=".env.production"VERCEL_BIN="${VERCEL_BIN:-vercel}"ENV_TYPE="encrypted" # store as encrypted secrets# --- sanity checksif ! command -v "$VERCEL_BIN" >/dev/null 2>&1; thenecho "Error: Vercel CLI not found. Install with: npm i -g vercel" >&2exit 1fiif [ ! -f "$ENV_FILE" ]; then
Showing the first 20 lines.
Get full code