Add back features
This commit is contained in:
parent
f18044b5c5
commit
15af685fd3
@ -1 +1 @@
|
|||||||
0.4.1
|
0.5.0
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{application,zx,
|
{application,zx,
|
||||||
[{description,"A Zomp user client"},
|
[{description,"An Erlang development tool and Zomp user client"},
|
||||||
{vsn,"0.4.1"},
|
{vsn,"0.5.0"},
|
||||||
{applications,[stdlib,kernel]},
|
{applications,[stdlib,kernel]},
|
||||||
{modules,[zx,zx_auth,zx_conn,zx_conn_sup,zx_daemon,zx_key,
|
{modules,[zx,zx_auth,zx_conn,zx_conn_sup,zx_daemon,zx_key,
|
||||||
zx_lib,zx_local,zx_net,zx_peer,zx_peer_man,
|
zx_lib,zx_local,zx_net,zx_peer,zx_peer_man,
|
||||||
@ -24,7 +24,7 @@
|
|||||||
%%% @end
|
%%% @end
|
||||||
|
|
||||||
-module(zx).
|
-module(zx).
|
||||||
-vsn("0.4.1").
|
-vsn("0.5.0").
|
||||||
-behavior(application).
|
-behavior(application).
|
||||||
-author("Craig Everett <zxq9@zxq9.com>").
|
-author("Craig Everett <zxq9@zxq9.com>").
|
||||||
-copyright("Craig Everett <zxq9@zxq9.com>").
|
-copyright("Craig Everett <zxq9@zxq9.com>").
|
||||||
@ -199,6 +199,12 @@ do(["set", "version", VersionString]) ->
|
|||||||
do(["provides", Module]) ->
|
do(["provides", Module]) ->
|
||||||
ok = zx_daemon:connect(),
|
ok = zx_daemon:connect(),
|
||||||
done(zx_local:provides(Module));
|
done(zx_local:provides(Module));
|
||||||
|
do(["search"]) ->
|
||||||
|
done(help(user));
|
||||||
|
do(["search" | Terms]) ->
|
||||||
|
ok = zx_daemon:connect(),
|
||||||
|
Strings = string:join(Terms, " "),
|
||||||
|
done(zx_local:search(Strings));
|
||||||
do(["update", "meta"]) ->
|
do(["update", "meta"]) ->
|
||||||
done(zx_local:update_meta());
|
done(zx_local:update_meta());
|
||||||
do(["update", ".app"]) ->
|
do(["update", ".app"]) ->
|
||||||
@ -809,8 +815,11 @@ execute(cli, PackageID, Meta, Dir, RunArgs) ->
|
|||||||
AppTag = list_to_atom(Name),
|
AppTag = list_to_atom(Name),
|
||||||
{ok, _} = application:ensure_all_started(AppTag),
|
{ok, _} = application:ensure_all_started(AppTag),
|
||||||
case maps:get(mod, Meta, none) of
|
case maps:get(mod, Meta, none) of
|
||||||
none -> {error, "No executable module"};
|
none ->
|
||||||
Mod -> Mod:start(RunArgs)
|
{error, "No executable module"};
|
||||||
|
ModName ->
|
||||||
|
Mod = list_to_atom(ModName),
|
||||||
|
Mod:start(RunArgs)
|
||||||
end;
|
end;
|
||||||
execute(Type, PackageID, Meta, Dir, RunArgs) ->
|
execute(Type, PackageID, Meta, Dir, RunArgs) ->
|
||||||
{ok, PackageString} = zx_lib:package_string(PackageID),
|
{ok, PackageString} = zx_lib:package_string(PackageID),
|
||||||
@ -9,7 +9,7 @@
|
|||||||
%%% @end
|
%%% @end
|
||||||
|
|
||||||
-module(zx_auth).
|
-module(zx_auth).
|
||||||
-vsn("0.4.1").
|
-vsn("0.5.0").
|
||||||
-author("Craig Everett <zxq9@zxq9.com>").
|
-author("Craig Everett <zxq9@zxq9.com>").
|
||||||
-copyright("Craig Everett <zxq9@zxq9.com>").
|
-copyright("Craig Everett <zxq9@zxq9.com>").
|
||||||
-license("GPL-3.0").
|
-license("GPL-3.0").
|
||||||
@ -7,7 +7,7 @@
|
|||||||
%%% @end
|
%%% @end
|
||||||
|
|
||||||
-module(zx_conn).
|
-module(zx_conn).
|
||||||
-vsn("0.4.1").
|
-vsn("0.5.0").
|
||||||
-author("Craig Everett <zxq9@zxq9.com>").
|
-author("Craig Everett <zxq9@zxq9.com>").
|
||||||
-copyright("Craig Everett <zxq9@zxq9.com>").
|
-copyright("Craig Everett <zxq9@zxq9.com>").
|
||||||
-license("GPL-3.0").
|
-license("GPL-3.0").
|
||||||
@ -5,7 +5,7 @@
|
|||||||
%%% @end
|
%%% @end
|
||||||
|
|
||||||
-module(zx_conn_sup).
|
-module(zx_conn_sup).
|
||||||
-vsn("0.4.1").
|
-vsn("0.5.0").
|
||||||
-behavior(supervisor).
|
-behavior(supervisor).
|
||||||
-author("Craig Everett <zxq9@zxq9.com>").
|
-author("Craig Everett <zxq9@zxq9.com>").
|
||||||
-copyright("Craig Everett <zxq9@zxq9.com>").
|
-copyright("Craig Everett <zxq9@zxq9.com>").
|
||||||
@ -138,7 +138,7 @@
|
|||||||
%%% @end
|
%%% @end
|
||||||
|
|
||||||
-module(zx_daemon).
|
-module(zx_daemon).
|
||||||
-vsn("0.4.1").
|
-vsn("0.5.0").
|
||||||
-behavior(gen_server).
|
-behavior(gen_server).
|
||||||
-author("Craig Everett <zxq9@zxq9.com>").
|
-author("Craig Everett <zxq9@zxq9.com>").
|
||||||
-copyright("Craig Everett <zxq9@zxq9.com>").
|
-copyright("Craig Everett <zxq9@zxq9.com>").
|
||||||
@ -148,7 +148,7 @@
|
|||||||
-export([pass_meta/3, argv/0,
|
-export([pass_meta/3, argv/0,
|
||||||
subscribe/1, unsubscribe/1,
|
subscribe/1, unsubscribe/1,
|
||||||
list/0, list/1, list/2, list/3, latest/1,
|
list/0, list/1, list/2, list/3, latest/1,
|
||||||
describe/1, provides/2, list_deps/1,
|
describe/1, provides/2, list_deps/1, search/2,
|
||||||
list_sysops/1,
|
list_sysops/1,
|
||||||
fetch/1, install/1, build/1,
|
fetch/1, install/1, build/1,
|
||||||
wait_result/1, wait_results/1]).
|
wait_result/1, wait_results/1]).
|
||||||
@ -489,6 +489,15 @@ provides(Realm, Module) ->
|
|||||||
request({provides, Realm, Module}).
|
request({provides, Realm, Module}).
|
||||||
|
|
||||||
|
|
||||||
|
-spec search(Realm, String) -> {ok, RequestID}
|
||||||
|
when Realm :: zx:realm(),
|
||||||
|
String :: string(),
|
||||||
|
RequestID :: integer().
|
||||||
|
|
||||||
|
search(Realm, String) ->
|
||||||
|
request({search, Realm, String}).
|
||||||
|
|
||||||
|
|
||||||
-spec list_deps(PackageID) -> {ok, RequestID}
|
-spec list_deps(PackageID) -> {ok, RequestID}
|
||||||
when PackageID :: zx:package_id(),
|
when PackageID :: zx:package_id(),
|
||||||
RequestID :: integer().
|
RequestID :: integer().
|
||||||
@ -1366,6 +1375,7 @@ local_request(R, {latest, N}) -> zomp_realm:latest(R, N);
|
|||||||
local_request(R, {latest, N, V}) -> zomp_realm:latest(R, {N, V});
|
local_request(R, {latest, N, V}) -> zomp_realm:latest(R, {N, V});
|
||||||
local_request(R, {describe, N, V}) -> zomp_realm:describe(R, {N, V});
|
local_request(R, {describe, N, V}) -> zomp_realm:describe(R, {N, V});
|
||||||
local_request(R, {provides, M}) -> zomp_realm:provides(R, M);
|
local_request(R, {provides, M}) -> zomp_realm:provides(R, M);
|
||||||
|
local_request(R, {search, S}) -> zomp_realm:search(R, S);
|
||||||
local_request(R, {list_deps, N, V}) -> zomp_realm:list_deps(R, {N, V});
|
local_request(R, {list_deps, N, V}) -> zomp_realm:list_deps(R, {N, V});
|
||||||
local_request(R, {list_sysops}) -> zomp_realm:list_sysops(R).
|
local_request(R, {list_sysops}) -> zomp_realm:list_sysops(R).
|
||||||
|
|
||||||
@ -8,7 +8,7 @@
|
|||||||
%%% @end
|
%%% @end
|
||||||
|
|
||||||
-module(zx_key).
|
-module(zx_key).
|
||||||
-vsn("0.4.1").
|
-vsn("0.5.0").
|
||||||
-author("Craig Everett <zxq9@zxq9.com>").
|
-author("Craig Everett <zxq9@zxq9.com>").
|
||||||
-copyright("Craig Everett <zxq9@zxq9.com>").
|
-copyright("Craig Everett <zxq9@zxq9.com>").
|
||||||
-license("GPL-3.0").
|
-license("GPL-3.0").
|
||||||
@ -10,7 +10,7 @@
|
|||||||
%%% @end
|
%%% @end
|
||||||
|
|
||||||
-module(zx_lib).
|
-module(zx_lib).
|
||||||
-vsn("0.4.1").
|
-vsn("0.5.0").
|
||||||
-author("Craig Everett <zxq9@zxq9.com>").
|
-author("Craig Everett <zxq9@zxq9.com>").
|
||||||
-copyright("Craig Everett <zxq9@zxq9.com>").
|
-copyright("Craig Everett <zxq9@zxq9.com>").
|
||||||
-license("GPL-3.0").
|
-license("GPL-3.0").
|
||||||
@ -6,14 +6,14 @@
|
|||||||
%%% @end
|
%%% @end
|
||||||
|
|
||||||
-module(zx_local).
|
-module(zx_local).
|
||||||
-vsn("0.4.1").
|
-vsn("0.5.0").
|
||||||
-author("Craig Everett <zxq9@zxq9.com>").
|
-author("Craig Everett <zxq9@zxq9.com>").
|
||||||
-copyright("Craig Everett <zxq9@zxq9.com>").
|
-copyright("Craig Everett <zxq9@zxq9.com>").
|
||||||
-license("GPL-3.0").
|
-license("GPL-3.0").
|
||||||
|
|
||||||
-export([initialize/0, set_version/1,
|
-export([initialize/0, set_version/1,
|
||||||
list_realms/0, list_packages/1, list_versions/1,
|
list_realms/0, list_packages/1, list_versions/1,
|
||||||
latest/1, describe/1, provides/1,
|
latest/1, describe/1, provides/1, search/1,
|
||||||
list_sysops/1,
|
list_sysops/1,
|
||||||
set_dep/1, list_deps/0, list_deps/1, drop_dep/1, verup/1, package/1,
|
set_dep/1, list_deps/0, list_deps/1, drop_dep/1, verup/1, package/1,
|
||||||
update_meta/0, update_app_file/0,
|
update_meta/0, update_app_file/0,
|
||||||
@ -89,7 +89,7 @@ initialize(P = #project{type = lib, id = none}) ->
|
|||||||
initialize(P#project{id = ask_package_id()});
|
initialize(P#project{id = ask_package_id()});
|
||||||
initialize(P = #project{id = none}) ->
|
initialize(P = #project{id = none}) ->
|
||||||
ID = {_, Name, _} = ask_package_id(),
|
ID = {_, Name, _} = ask_package_id(),
|
||||||
initialize(P#project{id = ID, appmod = list_to_atom(Name)});
|
initialize(P#project{id = ID, appmod = Name});
|
||||||
initialize(P = #project{prefix = none}) ->
|
initialize(P = #project{prefix = none}) ->
|
||||||
initialize(P#project{prefix = ask_prefix()});
|
initialize(P#project{prefix = ask_prefix()});
|
||||||
initialize(P = #project{type = app, appmod = none}) ->
|
initialize(P = #project{type = app, appmod = none}) ->
|
||||||
@ -202,7 +202,7 @@ initialize(P = #project{type = Type,
|
|||||||
"[ 7] Copyright Holder's Email: ~ts~n"
|
"[ 7] Copyright Holder's Email: ~ts~n"
|
||||||
"[ 8] License : ~ts~n"
|
"[ 8] License : ~ts~n"
|
||||||
"[ 9] Prefix : ~ts~n"
|
"[ 9] Prefix : ~ts~n"
|
||||||
"[10] AppMod : ~tw~n"
|
"[10] AppMod : ~ts~n"
|
||||||
"[11] Repo URL : ~ts~n"
|
"[11] Repo URL : ~ts~n"
|
||||||
"[12] Website URL : ~ts~n"
|
"[12] Website URL : ~ts~n"
|
||||||
"[13] Description : ~ts~n"
|
"[13] Description : ~ts~n"
|
||||||
@ -279,7 +279,7 @@ zompify(P = #project{type = Type,
|
|||||||
appmod = AM,
|
appmod = AM,
|
||||||
module = Module,
|
module = Module,
|
||||||
deps = Deps}) ->
|
deps = Deps}) ->
|
||||||
ok = initialize_app_file(ID, AM, Type, Desc),
|
ok = initialize_app_file(ID, list_to_atom(AM), Type, Desc),
|
||||||
Simple =
|
Simple =
|
||||||
#{type => Type,
|
#{type => Type,
|
||||||
package_id => ID,
|
package_id => ID,
|
||||||
@ -432,7 +432,6 @@ initialize_app_file({_, Name, Version}, AppMod, Type, Desc) ->
|
|||||||
end,
|
end,
|
||||||
Grep = "grep -oP '^-module\\(\\K[^)]+' src/* | cut -d: -f2",
|
Grep = "grep -oP '^-module\\(\\K[^)]+' src/* | cut -d: -f2",
|
||||||
Modules = [list_to_atom(M) || M <- string:lexemes(os:cmd(Grep), "\n")],
|
Modules = [list_to_atom(M) || M <- string:lexemes(os:cmd(Grep), "\n")],
|
||||||
tell("AppMod: ~p", [AppMod]),
|
|
||||||
Properties =
|
Properties =
|
||||||
case (Type == cli) or (Type == lib) of
|
case (Type == cli) or (Type == lib) of
|
||||||
true ->
|
true ->
|
||||||
@ -823,15 +822,50 @@ provides(Module) ->
|
|||||||
{ok, ID} = zx_daemon:provides(Realm, Module),
|
{ok, ID} = zx_daemon:provides(Realm, Module),
|
||||||
ID
|
ID
|
||||||
end,
|
end,
|
||||||
IDs = [MakeRequest(R) || R <- Realms],
|
Index = [{MakeRequest(R), R} || R <- Realms],
|
||||||
|
IDs = [element(1, I) || I <- Index],
|
||||||
case zx_daemon:wait_results(IDs) of
|
case zx_daemon:wait_results(IDs) of
|
||||||
{ok, Results} ->
|
{ok, Results} -> provides2(lists:sort(Index), lists:sort(Results));
|
||||||
Packages = lists:append([R || {_, {ok, R}} <- Results]),
|
Error -> Error
|
||||||
lists:foreach(fun print_packages/1, Packages);
|
|
||||||
Error ->
|
|
||||||
Error
|
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
provides2([{ID, Realm} | Index], [{ID, {ok, Packages}} | Results]) ->
|
||||||
|
FormID = fun({Name, Version}) -> {Realm, Name, Version} end,
|
||||||
|
ok = lists:foreach(fun print_packages/1, lists:map(FormID, lists:sort(Packages))),
|
||||||
|
provides2(Index, Results);
|
||||||
|
provides2([{ID, Realm} | Index], [{ID, Error} | Results]) ->
|
||||||
|
ok = tell(warning, "Received weird result from ~p: ~p", [Realm, Error]),
|
||||||
|
provides2(Index, Results);
|
||||||
|
provides2([], []) ->
|
||||||
|
ok.
|
||||||
|
|
||||||
|
|
||||||
|
search(String) ->
|
||||||
|
Realms = zx_lib:list_realms(),
|
||||||
|
MakeRequest =
|
||||||
|
fun(Realm) ->
|
||||||
|
{ok, ID} = zx_daemon:search(Realm, String),
|
||||||
|
ID
|
||||||
|
end,
|
||||||
|
Index = [{MakeRequest(R), R} || R <- Realms],
|
||||||
|
IDs = [element(1, I) || I <- Index],
|
||||||
|
case zx_daemon:wait_results(IDs) of
|
||||||
|
{ok, Results} -> search2(lists:sort(Index), lists:sort(Results));
|
||||||
|
Error -> Error
|
||||||
|
end.
|
||||||
|
|
||||||
|
search2([{ID, Realm} | Index], [{ID, {ok, Packages}} | Results]) ->
|
||||||
|
FormIDs = fun({Name, Versions}) -> [{Realm, Name, V} || V <- Versions] end,
|
||||||
|
Print = fun(PackageIDs) -> lists:foreach(fun print_packages/1, PackageIDs) end,
|
||||||
|
ok = lists:foreach(Print, lists:map(FormIDs, lists:sort(Packages))),
|
||||||
|
search2(Index, Results);
|
||||||
|
search2([{ID, Realm} | Index], [{ID, Error} | Results]) ->
|
||||||
|
ok = tell(warning, "Received weird result from ~p: ~p", [Realm, Error]),
|
||||||
|
search2(Index, Results);
|
||||||
|
search2([], []) ->
|
||||||
|
ok.
|
||||||
|
|
||||||
|
|
||||||
print_packages(PackageID) ->
|
print_packages(PackageID) ->
|
||||||
{ok, PackageString} = zx_lib:package_string(PackageID),
|
{ok, PackageString} = zx_lib:package_string(PackageID),
|
||||||
io:format("~ts~n", [PackageString]).
|
io:format("~ts~n", [PackageString]).
|
||||||
@ -1127,10 +1161,10 @@ create(P = #project{type = escript, id = none}) ->
|
|||||||
create(P#project{id = ask_script_name()});
|
create(P#project{id = ask_script_name()});
|
||||||
create(P = #project{type = lib, id = none}) ->
|
create(P = #project{type = lib, id = none}) ->
|
||||||
ID = {_, Module, _} = ask_package_id(),
|
ID = {_, Module, _} = ask_package_id(),
|
||||||
create(P#project{id = ID, module = list_to_atom(Module)});
|
create(P#project{id = ID, module = Module});
|
||||||
create(P = #project{id = none}) ->
|
create(P = #project{id = none}) ->
|
||||||
ID = {_, AppMod, _} = ask_package_id(),
|
ID = {_, AppMod, _} = ask_package_id(),
|
||||||
create(P#project{id = ID, appmod = list_to_atom(AppMod)});
|
create(P#project{id = ID, appmod = AppMod});
|
||||||
create(P = #project{prefix = none}) ->
|
create(P = #project{prefix = none}) ->
|
||||||
create(P#project{prefix = ask_prefix()});
|
create(P#project{prefix = ask_prefix()});
|
||||||
create(P = #project{type = app, appmod = none}) ->
|
create(P = #project{type = app, appmod = none}) ->
|
||||||
@ -1187,7 +1221,7 @@ create(P = #project{type = lib,
|
|||||||
"[ 7] Copyright Holder's Email: ~ts~n"
|
"[ 7] Copyright Holder's Email: ~ts~n"
|
||||||
"[ 8] License : ~ts~n"
|
"[ 8] License : ~ts~n"
|
||||||
"[ 9] Prefix : ~ts~n"
|
"[ 9] Prefix : ~ts~n"
|
||||||
"[10] Module : ~tw~n"
|
"[10] Module : ~ts~n"
|
||||||
"[11] Repo URL : ~ts~n"
|
"[11] Repo URL : ~ts~n"
|
||||||
"[12] Website URL : ~ts~n"
|
"[12] Website URL : ~ts~n"
|
||||||
"[13] Description : ~ts~n"
|
"[13] Description : ~ts~n"
|
||||||
@ -1242,7 +1276,7 @@ create(P = #project{type = cli,
|
|||||||
"[ 7] Copyright Holder's Email: ~ts~n"
|
"[ 7] Copyright Holder's Email: ~ts~n"
|
||||||
"[ 8] License : ~ts~n"
|
"[ 8] License : ~ts~n"
|
||||||
"[ 9] Prefix : ~ts~n"
|
"[ 9] Prefix : ~ts~n"
|
||||||
"[10] Module : ~tw~n"
|
"[10] Module : ~ts~n"
|
||||||
"[11] Repo URL : ~ts~n"
|
"[11] Repo URL : ~ts~n"
|
||||||
"[12] Website URL : ~ts~n"
|
"[12] Website URL : ~ts~n"
|
||||||
"[13] Description : ~ts~n"
|
"[13] Description : ~ts~n"
|
||||||
@ -1336,7 +1370,7 @@ create(P = #project{type = Type,
|
|||||||
"[ 7] Copyright Holder's Email: ~ts~n"
|
"[ 7] Copyright Holder's Email: ~ts~n"
|
||||||
"[ 8] License : ~ts~n"
|
"[ 8] License : ~ts~n"
|
||||||
"[ 9] Prefix : ~ts~n"
|
"[ 9] Prefix : ~ts~n"
|
||||||
"[10] AppMod : ~tw~n"
|
"[10] AppMod : ~ts~n"
|
||||||
"[11] Repo URL : ~ts~n"
|
"[11] Repo URL : ~ts~n"
|
||||||
"[12] Website URL : ~ts~n"
|
"[12] Website URL : ~ts~n"
|
||||||
"[13] Description : ~ts~n"
|
"[13] Description : ~ts~n"
|
||||||
@ -1447,13 +1481,13 @@ munge_sources(#project{type = lib,
|
|||||||
{ok, ProjectDir} = file:get_cwd(),
|
{ok, ProjectDir} = file:get_cwd(),
|
||||||
Substitutions =
|
Substitutions =
|
||||||
[{"〘\*PROJECT NAME\*〙", Name},
|
[{"〘\*PROJECT NAME\*〙", Name},
|
||||||
{"〘\*MODULE\*〙", atom_to_list(Module)},
|
{"〘\*MODULE\*〙", Module},
|
||||||
{"〘\*AUTHOR\*〙", author(Credit, AEmail)},
|
{"〘\*AUTHOR\*〙", author(Credit, AEmail)},
|
||||||
{"〘\*COPYRIGHT\*〙", copyright(Holder, CEmail)},
|
{"〘\*COPYRIGHT\*〙", copyright(Holder, CEmail)},
|
||||||
{"〘\*LICENSE\*〙", license(Title)}],
|
{"〘\*LICENSE\*〙", license(Title)}],
|
||||||
TemplateDir = filename:join([os:getenv("ZX_DIR"), "templates", "boringlib"]),
|
TemplateDir = filename:join([os:getenv("ZX_DIR"), "templates", "boringlib"]),
|
||||||
ok = file:set_cwd("src"),
|
ok = file:set_cwd("src"),
|
||||||
ModFile = atom_to_list(Module) ++ ".erl",
|
ModFile = Module ++ ".erl",
|
||||||
{ok, RawMod} = file:read_file(filename:join(TemplateDir, "funfile.erl")),
|
{ok, RawMod} = file:read_file(filename:join(TemplateDir, "funfile.erl")),
|
||||||
UTF8Mod = unicode:characters_to_list(RawMod, utf8),
|
UTF8Mod = unicode:characters_to_list(RawMod, utf8),
|
||||||
CookedMod = substitute(UTF8Mod, Substitutions),
|
CookedMod = substitute(UTF8Mod, Substitutions),
|
||||||
@ -1472,13 +1506,13 @@ munge_sources(#project{type = cli,
|
|||||||
{ok, ProjectDir} = file:get_cwd(),
|
{ok, ProjectDir} = file:get_cwd(),
|
||||||
Substitutions =
|
Substitutions =
|
||||||
[{"〘\*PROJECT NAME\*〙", Name},
|
[{"〘\*PROJECT NAME\*〙", Name},
|
||||||
{"〘\*MODULE\*〙", atom_to_list(Module)},
|
{"〘\*MODULE\*〙", Module},
|
||||||
{"〘\*AUTHOR\*〙", author(Credit, AEmail)},
|
{"〘\*AUTHOR\*〙", author(Credit, AEmail)},
|
||||||
{"〘\*COPYRIGHT\*〙", copyright(Holder, CEmail)},
|
{"〘\*COPYRIGHT\*〙", copyright(Holder, CEmail)},
|
||||||
{"〘\*LICENSE\*〙", license(Title)}],
|
{"〘\*LICENSE\*〙", license(Title)}],
|
||||||
TemplateDir = filename:join([os:getenv("ZX_DIR"), "templates"]),
|
TemplateDir = filename:join([os:getenv("ZX_DIR"), "templates"]),
|
||||||
ok = file:set_cwd("src"),
|
ok = file:set_cwd("src"),
|
||||||
ModFile = atom_to_list(Module) ++ ".erl",
|
ModFile = Module ++ ".erl",
|
||||||
{ok, RawMod} = file:read_file(filename:join(TemplateDir, "simplecli.erl")),
|
{ok, RawMod} = file:read_file(filename:join(TemplateDir, "simplecli.erl")),
|
||||||
UTF8Mod = unicode:characters_to_list(RawMod, utf8),
|
UTF8Mod = unicode:characters_to_list(RawMod, utf8),
|
||||||
CookedMod = substitute(UTF8Mod, Substitutions),
|
CookedMod = substitute(UTF8Mod, Substitutions),
|
||||||
@ -1499,7 +1533,7 @@ munge_sources(#project{type = Type,
|
|||||||
Substitutions =
|
Substitutions =
|
||||||
[{"〘\*PROJECT NAME\*〙", Name},
|
[{"〘\*PROJECT NAME\*〙", Name},
|
||||||
{"〘\*PREFIX\*〙", Prefix},
|
{"〘\*PREFIX\*〙", Prefix},
|
||||||
{"〘\*APP MOD\*〙", atom_to_list(AppMod)},
|
{"〘\*APP MOD\*〙", AppMod},
|
||||||
{"〘\*AUTHOR\*〙", author(Credit, AEmail)},
|
{"〘\*AUTHOR\*〙", author(Credit, AEmail)},
|
||||||
{"〘\*COPYRIGHT\*〙", copyright(Holder, CEmail)},
|
{"〘\*COPYRIGHT\*〙", copyright(Holder, CEmail)},
|
||||||
{"〘\*LICENSE\*〙", license(License)}],
|
{"〘\*LICENSE\*〙", license(License)}],
|
||||||
@ -1510,7 +1544,7 @@ munge_sources(#project{type = Type,
|
|||||||
end,
|
end,
|
||||||
TemplateDir = filename:join([os:getenv("ZX_DIR"), "templates", Template]),
|
TemplateDir = filename:join([os:getenv("ZX_DIR"), "templates", Template]),
|
||||||
ok = file:set_cwd("src"),
|
ok = file:set_cwd("src"),
|
||||||
AppModFile = atom_to_list(AppMod) ++ ".erl",
|
AppModFile = AppMod ++ ".erl",
|
||||||
{ok, RawAppMod} = file:read_file(filename:join(TemplateDir, "appmod.erl")),
|
{ok, RawAppMod} = file:read_file(filename:join(TemplateDir, "appmod.erl")),
|
||||||
UTF8AppMod = unicode:characters_to_list(RawAppMod, utf8),
|
UTF8AppMod = unicode:characters_to_list(RawAppMod, utf8),
|
||||||
CookedAppMod = substitute(UTF8AppMod, Substitutions),
|
CookedAppMod = substitute(UTF8AppMod, Substitutions),
|
||||||
@ -1691,7 +1725,7 @@ ask_appmod() ->
|
|||||||
"~nAPPLICATION MODULE~n"
|
"~nAPPLICATION MODULE~n"
|
||||||
"Enter the name of your main/start interface module where the application "
|
"Enter the name of your main/start interface module where the application "
|
||||||
"callback start/2 has been defined.~n",
|
"callback start/2 has been defined.~n",
|
||||||
list_to_atom(zx_tty:get_lower0_9(Instructions)).
|
zx_tty:get_lower0_9(Instructions).
|
||||||
|
|
||||||
|
|
||||||
-spec ask_module() -> atom() | no_return().
|
-spec ask_module() -> atom() | no_return().
|
||||||
@ -1700,7 +1734,7 @@ ask_module() ->
|
|||||||
Instructions =
|
Instructions =
|
||||||
"~nINTERFACE MODULE~n"
|
"~nINTERFACE MODULE~n"
|
||||||
"Enter the name of the library's initial interface module.~n",
|
"Enter the name of the library's initial interface module.~n",
|
||||||
list_to_atom(zx_tty:get_lower0_9(Instructions)).
|
zx_tty:get_lower0_9(Instructions).
|
||||||
|
|
||||||
|
|
||||||
-spec package_exists(zx:package_id()) -> boolean().
|
-spec package_exists(zx:package_id()) -> boolean().
|
||||||
@ -5,7 +5,7 @@
|
|||||||
%%% @end
|
%%% @end
|
||||||
|
|
||||||
-module(zx_net).
|
-module(zx_net).
|
||||||
-vsn("0.4.1").
|
-vsn("0.5.0").
|
||||||
-author("Craig Everett <zxq9@zxq9.com>").
|
-author("Craig Everett <zxq9@zxq9.com>").
|
||||||
-copyright("Craig Everett <zxq9@zxq9.com>").
|
-copyright("Craig Everett <zxq9@zxq9.com>").
|
||||||
-license("GPL-3.0").
|
-license("GPL-3.0").
|
||||||
@ -8,7 +8,7 @@
|
|||||||
%%% @end
|
%%% @end
|
||||||
|
|
||||||
-module(zx_peer).
|
-module(zx_peer).
|
||||||
-vsn("0.4.1").
|
-vsn("0.5.0").
|
||||||
-author("Craig Everett <zxq9@zxq9.com>").
|
-author("Craig Everett <zxq9@zxq9.com>").
|
||||||
-copyright("Craig Everett <zxq9@zxq9.com>").
|
-copyright("Craig Everett <zxq9@zxq9.com>").
|
||||||
-license("GPL-3.0").
|
-license("GPL-3.0").
|
||||||
@ -9,7 +9,7 @@
|
|||||||
%%% @end
|
%%% @end
|
||||||
|
|
||||||
-module(zx_peer_man).
|
-module(zx_peer_man).
|
||||||
-vsn("0.4.1").
|
-vsn("0.5.0").
|
||||||
-behavior(gen_server).
|
-behavior(gen_server).
|
||||||
-author("Craig Everett <zxq9@zxq9.com>").
|
-author("Craig Everett <zxq9@zxq9.com>").
|
||||||
-copyright("Craig Everett <zxq9@zxq9.com>").
|
-copyright("Craig Everett <zxq9@zxq9.com>").
|
||||||
@ -6,7 +6,7 @@
|
|||||||
%%% @end
|
%%% @end
|
||||||
|
|
||||||
-module(zx_peer_sup).
|
-module(zx_peer_sup).
|
||||||
-vsn("0.4.1").
|
-vsn("0.5.0").
|
||||||
-behaviour(supervisor).
|
-behaviour(supervisor).
|
||||||
-author("Craig Everett <zxq9@zxq9.com>").
|
-author("Craig Everett <zxq9@zxq9.com>").
|
||||||
-copyright("Craig Everett <zxq9@zxq9.com>").
|
-copyright("Craig Everett <zxq9@zxq9.com>").
|
||||||
@ -10,7 +10,7 @@
|
|||||||
%%% @end
|
%%% @end
|
||||||
|
|
||||||
-module(zx_peers).
|
-module(zx_peers).
|
||||||
-vsn("0.4.1").
|
-vsn("0.5.0").
|
||||||
-behavior(supervisor).
|
-behavior(supervisor).
|
||||||
-author("Craig Everett <zxq9@zxq9.com>").
|
-author("Craig Everett <zxq9@zxq9.com>").
|
||||||
-copyright("Craig Everett <zxq9@zxq9.com>").
|
-copyright("Craig Everett <zxq9@zxq9.com>").
|
||||||
@ -5,7 +5,7 @@
|
|||||||
%%% @end
|
%%% @end
|
||||||
|
|
||||||
-module(zx_proxy).
|
-module(zx_proxy).
|
||||||
-vsn("0.4.1").
|
-vsn("0.5.0").
|
||||||
-author("Craig Everett <zxq9@zxq9.com>").
|
-author("Craig Everett <zxq9@zxq9.com>").
|
||||||
-copyright("Craig Everett <zxq9@zxq9.com>").
|
-copyright("Craig Everett <zxq9@zxq9.com>").
|
||||||
-license("GPL-3.0").
|
-license("GPL-3.0").
|
||||||
@ -5,7 +5,7 @@
|
|||||||
%%% @end
|
%%% @end
|
||||||
|
|
||||||
-module(zx_sup).
|
-module(zx_sup).
|
||||||
-vsn("0.4.1").
|
-vsn("0.5.0").
|
||||||
-behavior(supervisor).
|
-behavior(supervisor).
|
||||||
-author("Craig Everett <zxq9@zxq9.com>").
|
-author("Craig Everett <zxq9@zxq9.com>").
|
||||||
-copyright("Craig Everett <zxq9@zxq9.com>").
|
-copyright("Craig Everett <zxq9@zxq9.com>").
|
||||||
@ -6,7 +6,7 @@
|
|||||||
%%% @end
|
%%% @end
|
||||||
|
|
||||||
-module(zx_tty).
|
-module(zx_tty).
|
||||||
-vsn("0.4.1").
|
-vsn("0.5.0").
|
||||||
-author("Craig Everett <zxq9@zxq9.com>").
|
-author("Craig Everett <zxq9@zxq9.com>").
|
||||||
-copyright("Craig Everett <zxq9@zxq9.com>").
|
-copyright("Craig Everett <zxq9@zxq9.com>").
|
||||||
-license("GPL-3.0").
|
-license("GPL-3.0").
|
||||||
@ -5,7 +5,7 @@
|
|||||||
%%% @end
|
%%% @end
|
||||||
|
|
||||||
-module(zx_userconf).
|
-module(zx_userconf).
|
||||||
-vsn("0.4.1").
|
-vsn("0.5.0").
|
||||||
-author("Craig Everett <zxq9@zxq9.com>").
|
-author("Craig Everett <zxq9@zxq9.com>").
|
||||||
-copyright("Craig Everett <zxq9@zxq9.com>").
|
-copyright("Craig Everett <zxq9@zxq9.com>").
|
||||||
-license("GPL-3.0").
|
-license("GPL-3.0").
|
||||||
@ -7,7 +7,7 @@
|
|||||||
%%% @end
|
%%% @end
|
||||||
|
|
||||||
-module(zx_zsp).
|
-module(zx_zsp).
|
||||||
-vsn("0.4.1").
|
-vsn("0.5.0").
|
||||||
-author("Craig Everett <zxq9@zxq9.com>").
|
-author("Craig Everett <zxq9@zxq9.com>").
|
||||||
-copyright("Craig Everett <zxq9@zxq9.com>").
|
-copyright("Craig Everett <zxq9@zxq9.com>").
|
||||||
-license("GPL-3.0").
|
-license("GPL-3.0").
|
||||||
@ -3,14 +3,14 @@
|
|||||||
{c_email,"zxq9@zxq9.com"}.
|
{c_email,"zxq9@zxq9.com"}.
|
||||||
{copyright,"Craig Everett"}.
|
{copyright,"Craig Everett"}.
|
||||||
{deps,[]}.
|
{deps,[]}.
|
||||||
{desc,"A Zomp user client"}.
|
{desc,"An Erlang development tool and Zomp user client"}.
|
||||||
{key_name,none}.
|
{key_name,none}.
|
||||||
{license,"MIT"}.
|
{license,"MIT"}.
|
||||||
{modules,[]}.
|
{modules,[]}.
|
||||||
{name,"zx"}.
|
{name,"zx"}.
|
||||||
{package_id,{"otpr","zx",{0,4,1}}}.
|
{package_id,{"otpr","zx",{0,5,0}}}.
|
||||||
{prefix,"zx_"}.
|
{prefix,"zx_"}.
|
||||||
{repo_url,"https://gitlab.com/zxq9/zx"}.
|
{repo_url,"https://gitlab.com/zxq9/zx"}.
|
||||||
{tags,["package manager","erlang"]}.
|
{tags,["tools","package manager","erlang"]}.
|
||||||
{type,app}.
|
{type,app}.
|
||||||
{ws_url,"https://zxq9.com/projects/zomp/"}.
|
{ws_url,"https://zxq9.com/projects/zomp/"}.
|
||||||
Loading…
x
Reference in New Issue
Block a user