Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Made script ZSH-friendly #391

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions init/msm
Original file line number Diff line number Diff line change
Expand Up @@ -1196,7 +1196,7 @@ jargroup_delete() {
printf "Are you sure you want to delete this jar group [y/N]: "

read answer
if [[ "$answer" =~ ^y|Y|yes$ ]]; then
if [[ "$answer" =~ (^y|Y|yes$) ]]; then
as_user "$SETTINGS_USERNAME" "rm -rf \"$SETTINGS_JAR_STORAGE_PATH/$1\""
echo "Jar group deleted."
else
Expand Down Expand Up @@ -1793,7 +1793,7 @@ server_property() {
if [[ -z "${VERSIONS_NEWEST_MINECRAFT_PATH}" ]]; then
msm_warning "No version set for server, and no default found. Please use 'msm update' to download defaults"
else
if [[ ! "$arg" =~ logroll|config ]]; then
if [[ ! "$arg" =~ (logroll|config) ]]; then
msm_info "Assuming 'minecraft/${VERSIONS_NEWEST_MINECRAFT_VERSION}' for this server. You should override this value by adding 'msm-version=minecraft/x.x.x' to '${SERVER_CONF[$1]}' to make this message go away"
fi
SERVER_VERSION_CONF[$1]="${VERSIONS_NEWEST_MINECRAFT_PATH}"
Expand Down Expand Up @@ -1843,8 +1843,8 @@ server_property() {
# If not a non-overridable load from conf
read_server_conf "$1" "$2"

local target_varname=SERVER_$2[$1]
if [ -z "${!target_varname}" ]; then
eval local target_varname=\"\${SERVER_$2[$1]}\"
if [[ -z "$target_varname" ]]; then
# if its still empty use the default value
manager_property "DEFAULT_$2"
server_set_property "$1" "$2" "\$SETTINGS_DEFAULT_$2"
Expand Down