Skip to content

Commit c29ef64

Browse files
committed
Use Default Action and Version when not provided
1 parent 3b094ae commit c29ef64

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

hack/release-manager.sh

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ ROOT="$(dirname "$SCRIPT_DIR")"
99
source $SCRIPT_DIR/common-functions.sh
1010

1111
# Default values
12-
ACTION="update-upstream-versions"
13-
VERSION="next"
14-
ENVIRONMENT="dev"
12+
DEFAULT_ACTION="update-upstream-versions"
13+
DEFAULT_VERSION="next"
14+
ACTION=""
15+
VERSION=""
1516

1617

1718
help() {
@@ -56,10 +57,6 @@ while [[ $# -gt 0 ]]; do
5657
VERSION="$2"
5758
shift 2
5859
;;
59-
--env|--environment | -e)
60-
ENVIRONMENT="$2"
61-
shift 2
62-
;;
6360
--help|-h)
6461
help
6562
;;
@@ -70,10 +67,14 @@ while [[ $# -gt 0 ]]; do
7067
esac
7168
done
7269

73-
# Validate required params
74-
if [[ -z "$ACTION" || -z "$VERSION" ]]; then
75-
echo "Missing required parameters!"
76-
help
70+
# Use Default Values for required params
71+
if [[ -z "$ACTION" ]]; then
72+
echo "Using default action $DEFAULT_ACTION!"
73+
ACTION=$DEFAULT_ACTION
74+
fi
75+
if [[ -z "$VERSION" ]]; then
76+
echo "Using default version $DEFAULT_VERSION!"
77+
VERSION=$DEFAULT_VERSION
7778
fi
7879

7980
# Call specific function based on ACTION

0 commit comments

Comments
 (0)