Skip to content

Commit

Permalink
brl-rename: do not disable aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
paradigm committed Dec 17, 2018
1 parent aa629a4 commit 537586f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/slash-bedrock/libexec/brl-rename
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 537586f

Please sign in to comment.