From 94224a7ba096fca54cb65815a09f4033e46ca2ff Mon Sep 17 00:00:00 2001 From: Craig Everett Date: Mon, 6 Jan 2020 07:22:54 +0900 Subject: [PATCH] Allow users to initialize project names that already exist. --- zomp/lib/otpr/zx/0.6.0/src/zx_local.erl | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/zomp/lib/otpr/zx/0.6.0/src/zx_local.erl b/zomp/lib/otpr/zx/0.6.0/src/zx_local.erl index c504d96..722fbd2 100644 --- a/zomp/lib/otpr/zx/0.6.0/src/zx_local.erl +++ b/zomp/lib/otpr/zx/0.6.0/src/zx_local.erl @@ -241,11 +241,17 @@ initialize_check(P = #project{id = PackageID}) -> true -> Message = "~nDHOH!~n" - "Sadly this package already exists.~n" - "Two packages with the same name cannot exist in a single realm.~n" - "Please pick another name.~n", + "Sadly this package already exists in the selected realm.~n" + "What do?~n", ok = io:format(Message), - initialize(P#project{id = none}); + Options = [{"Pick another name.", 1}, + {"Continue anyway.", 2}, + {"Abort and do it later.", 3}], + case zx_tty:select(Options) of + 1 -> initialize(P#project{id = none}); + 2 -> zompify(P); + 3 -> ok + end; maybe -> Message = "~n∑(。・Д・。)???~nHmmm...~n"