From 537586f7c659b48f01642052f60a3da6bcbcd6b6 Mon Sep 17 00:00:00 2001 From: Daniel Thau Date: Mon, 17 Dec 2018 12:33:11 -0500 Subject: [PATCH] brl-rename: do not disable aliases --- src/slash-bedrock/libexec/brl-rename | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/slash-bedrock/libexec/brl-rename b/src/slash-bedrock/libexec/brl-rename index d777ba38..e7742d93 100755 --- a/src/slash-bedrock/libexec/brl-rename +++ b/src/slash-bedrock/libexec/brl-rename @@ -44,18 +44,20 @@ if ! is_stratum_or_alias "${stratum}"; then elif is_stratum_or_alias "${new_name}"; then abort "Pre-existing stratum or alias found called \"${new_name}\". Remove with \`brl remove ${stratum}\` first." elif [ "${stratum}" = "init" ]; then - abort "Removing init alias is disallowed." + abort "Renaming init alias is disallowed." elif is_bedrock "${stratum}"; then abort "Renaming bedrock stratum is disallowed." elif is_init "${stratum}"; then abort "Renaming init-providing stratum is disallowed." -elif is_enabled "${stratum}"; then +elif is_stratum "${stratum}" && is_enabled "${stratum}"; then abort "\"${stratum}\" is enabled. Disable with \`brl disable ${stratum}\` first." fi ensure_legal_stratum_name "${new_name}" -disable_stratum "${stratum}" +if is_stratum "${stratum}"; then + disable_stratum "${stratum}" +fi mv "/bedrock/strata/${stratum}" "/bedrock/strata/${new_name}" exit_success