Minor
This commit is contained in:
parent
b5c072d0b0
commit
afd9607a97
@ -299,7 +299,8 @@ done({error, Reason}) ->
|
||||
init:stop(1);
|
||||
done({error, Info, Code}) ->
|
||||
ok = zx_daemon:idle(),
|
||||
ok = tell(error, "Error: ~160tp: ~160tp", [Info, Code]),
|
||||
Message = "Operation failed with: ~160tp",
|
||||
ok = tell(error, Message, [Info]),
|
||||
init:stop(Code).
|
||||
|
||||
|
||||
@ -760,7 +761,7 @@ upgrade() ->
|
||||
tell("Upgraded to ~s.", [NewString]);
|
||||
{ok, Available} when Available < Current ->
|
||||
{ok, AvailableString} = zx_lib:version_to_string(Available),
|
||||
Message = "Local version is newer than ~s. Nothing to do.~n",
|
||||
Message = "Local version is newer than ~s. Nothing to do.",
|
||||
ok = tell(Message, [AvailableString]);
|
||||
Error ->
|
||||
Error
|
||||
|
||||
@ -88,8 +88,8 @@ initialize(P = #project{type = escript}) ->
|
||||
initialize(P = #project{type = lib, id = none}) ->
|
||||
initialize(P#project{id = ask_package_id()});
|
||||
initialize(P = #project{id = none}) ->
|
||||
ID = {_, AppMod, _} = ask_package_id(),
|
||||
initialize(P#project{id = ID, appmod = AppMod});
|
||||
ID = {_, Name, _} = ask_package_id(),
|
||||
initialize(P#project{id = ID, appmod = list_to_atom(Name)});
|
||||
initialize(P = #project{prefix = none}) ->
|
||||
initialize(P#project{prefix = ask_prefix()});
|
||||
initialize(P = #project{type = app, appmod = none}) ->
|
||||
@ -202,7 +202,7 @@ initialize(P = #project{type = Type,
|
||||
"[ 7] Copyright Holder's Email: ~ts~n"
|
||||
"[ 8] License : ~ts~n"
|
||||
"[ 9] Prefix : ~ts~n"
|
||||
"[10] AppMod : ~ts~n"
|
||||
"[10] AppMod : ~tw~n"
|
||||
"[11] Repo URL : ~ts~n"
|
||||
"[12] Website URL : ~ts~n"
|
||||
"[13] Description : ~ts~n"
|
||||
@ -706,7 +706,7 @@ update_version(Realm, Name, OldVersion, NewVersion, OldMeta) ->
|
||||
|
||||
list_realms() ->
|
||||
case zx_lib:list_realms() of
|
||||
[] -> tell(error, "Oh noes! No realms are configured!~n");
|
||||
[] -> tell(error, "Oh noes! No realms are configured!");
|
||||
Realms -> lists:foreach(fun(R) -> io:format("~ts~n", [R]) end, Realms)
|
||||
end.
|
||||
|
||||
@ -719,7 +719,7 @@ list_realms() ->
|
||||
list_packages(Realm) ->
|
||||
{ok, ID} = zx_daemon:list(Realm),
|
||||
case zx_daemon:wait_result(ID) of
|
||||
{ok, []} -> tell(error, "No packages available.~n");
|
||||
{ok, []} -> tell(error, "No packages available.");
|
||||
{ok, Packages} -> lists:foreach(print_package(Realm), Packages);
|
||||
{error, bad_realm} -> {error, "Unconfigured realm or bad realm name.", 22};
|
||||
{error, timeout} -> {error, "Request timed out.", 62};
|
||||
@ -745,7 +745,7 @@ list_versions(PackageString) ->
|
||||
list_versions2({Realm, Name, Version}) ->
|
||||
{ok, ID} = zx_daemon:list(Realm, Name, Version),
|
||||
case zx_daemon:wait_result(ID) of
|
||||
{ok, []} -> tell(error, "No versions available.~n");
|
||||
{ok, []} -> tell(error, "No versions available.");
|
||||
{ok, Versions} -> lists:foreach(fun print_version/1, Versions);
|
||||
{error, bad_realm} -> {error, "Bad realm name.", 22};
|
||||
{error, bad_package} -> {error, "Bad package name.", 22};
|
||||
@ -787,6 +787,8 @@ describe2(PackageID) ->
|
||||
case zx_daemon:wait_result(ID) of
|
||||
{ok, Description} -> describe3(Description);
|
||||
{error, bad_realm} -> {error, "Unconfigured realm or bad realm name.", 22};
|
||||
{error, bad_package} -> {error, "Bad package name.", 22};
|
||||
{error, bad_version} -> {error, "Bad version.", 22};
|
||||
{error, timeout} -> {error, "Request timed out.", 62};
|
||||
{error, network} -> {error, "Network problem connecting to realm.", 101}
|
||||
end.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user