Skip to content

Commit

Permalink
Merge branch 'improve/java-require-namespace'
Browse files Browse the repository at this point in the history
  • Loading branch information
kilo52 committed Jan 28, 2024
2 parents 9cf40d8 + 48a45df commit 31e52fe
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions java/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ function form_java_version() {
function _validate_java_namespace() {
local input="$1";
if [ -z "$input" ]; then
return 0;
logI "Please specify a namespace";
return 1;
fi
# Check for expected pattern
local re="^[a-z.]*$";
Expand Down Expand Up @@ -178,16 +179,9 @@ function form_java_namespace() {
read_user_input_text _validate_java_namespace;
local entered_namespace="$USER_INPUT_ENTERED_TEXT";

# Validate given answer
if [ -z "$entered_namespace" ]; then
logI "No namespace will be used";
fi
var_namespace="$entered_namespace";
var_namespace_path="${var_namespace//.//}";
var_namespace_trailing_sep="";
if [ -n "$var_namespace" ]; then
var_namespace_trailing_sep="$var_namespace.";
fi
var_namespace_trailing_sep="${var_namespace}.";
if [[ $var_namespace == *"."* ]]; then
var_namespace_0="${var_namespace%%.*}";
else
Expand Down

0 comments on commit 31e52fe

Please sign in to comment.