Skip to content

Commit

Permalink
Make BUILD_ENV required and explicit
Browse files Browse the repository at this point in the history
  • Loading branch information
mraveux committed Nov 25, 2024
1 parent ee1d0b4 commit cbff5f7
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ show_usage() {
echo
fi

echo -e "${BLUE}Usage: $0 <version_number> -m <commit_message> --deployer=NAME [--exclude-release] [--no-translations] [--mainnet] [--deploy-only]${NC}"
echo -e "${BLUE}Usage: $0 <version_number> -m <commit_message> --deployer=NAME [--exclude-release] [--no-translations] [--mainnet|--testnet] [--deploy-only]${NC}"
echo
echo -e "${CYAN}Examples:${NC}"
echo "1. Simple message (testnet):"
echo -e " ${GREEN}$0 3.0.10 -m 'Fix network stall handling' --deployer=matheo${NC}"
echo -e " ${GREEN}$0 3.0.10 -m 'Fix network stall handling' --deployer=matheo --testnet${NC}"
echo
echo "2. Multi-line message (mainnet):"
echo -e " ${GREEN}$0 3.0.4 -m '- Move network browsers-not-shown warning to not overlap with bottom row"
Expand Down Expand Up @@ -54,7 +54,7 @@ fi
DEPLOYER=""
EXCLUDE_RELEASE=""
SYNC_TRANSLATIONS=true
BUILD_ENV="testnet"
BUILD_ENV=""
DEPLOY_ONLY=false

# Parse remaining arguments
Expand All @@ -80,6 +80,10 @@ while [[ $# -gt 0 ]]; do
BUILD_ENV="mainnet"
shift
;;
--testnet)
BUILD_ENV="testnet"
shift
;;
--deploy-only)
DEPLOY_ONLY=true
shift
Expand Down Expand Up @@ -108,6 +112,9 @@ if [ "$DEPLOY_ONLY" = false ]; then
if [ -z "$COMMIT_MSG" ]; then
show_usage "commit message (-m) is required"
fi
if [ -z "$BUILD_ENV" ]; then
show_usage "Either --mainnet or --testnet must be specified"
fi
fi

# Validate version number format
Expand Down

0 comments on commit cbff5f7

Please sign in to comment.