0.12.3: Correct launch optimization, fix local file deletion bug on failed run start.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{application,zx,
|
||||
[{description,"An Erlang development tool and Zomp user client"},
|
||||
{vsn,"0.12.2"},
|
||||
{vsn,"0.12.3"},
|
||||
{applications,[stdlib,kernel]},
|
||||
{modules,[zx,zx_auth,zx_conn,zx_conn_sup,zx_daemon,zx_key,
|
||||
zx_lib,zx_local,zx_net,zx_peer,zx_peer_man,
|
||||
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
@@ -24,7 +24,7 @@
|
||||
%%% @end
|
||||
|
||||
-module(zx).
|
||||
-vsn("0.12.2").
|
||||
-vsn("0.12.3").
|
||||
-behavior(application).
|
||||
-author("Craig Everett <zxq9@zxq9.com>").
|
||||
-copyright("Craig Everett <zxq9@zxq9.com>").
|
||||
@@ -404,27 +404,28 @@ compatibility_check(Platforms) ->
|
||||
%% @equiv application:ensure_started(zx).
|
||||
|
||||
start() ->
|
||||
LogPath =
|
||||
case init:get_plain_arguments() of
|
||||
["run", PackageString | _] ->
|
||||
case zx_lib:package_id(PackageString) of
|
||||
{ok, PackageID} -> zx_lib:new_logpath(PackageID);
|
||||
Error -> done(Error)
|
||||
end;
|
||||
["rundir", Path | _] ->
|
||||
case zx_lib:read_project_meta(Path) of
|
||||
{ok, #{package_id := PackageID}} -> zx_lib:new_logpath(PackageID);
|
||||
Error -> done(Error)
|
||||
end;
|
||||
["runlocal" | _] ->
|
||||
case zx_lib:read_project_meta() of
|
||||
{ok, #{package_id := PackageID}} -> zx_lib:new_logpath(PackageID);
|
||||
Error -> done(Error)
|
||||
end;
|
||||
_ ->
|
||||
{ok, Version} = zx_lib:string_to_version(os:getenv("ZX_VERSION")),
|
||||
zx_lib:new_logpath({"otpr", "zx", Version})
|
||||
end,
|
||||
case init:get_plain_arguments() of
|
||||
["run", PackageString | _] ->
|
||||
case zx_lib:package_id(PackageString) of
|
||||
{ok, PackID} -> start(zx_lib:new_logpath(PackID));
|
||||
Error -> done(Error)
|
||||
end;
|
||||
["rundir", Path | _] ->
|
||||
case zx_lib:read_project_meta(Path) of
|
||||
{ok, #{package_id := PackID}} -> start(zx_lib:new_logpath(PackID));
|
||||
Error -> done(Error)
|
||||
end;
|
||||
["runlocal" | _] ->
|
||||
case zx_lib:read_project_meta() of
|
||||
{ok, #{package_id := PackID}} -> start(zx_lib:new_logpath(PackID));
|
||||
Error -> done(Error)
|
||||
end;
|
||||
_ ->
|
||||
{ok, Version} = zx_lib:string_to_version(os:getenv("ZX_VERSION")),
|
||||
start(zx_lib:new_logpath({"otpr", "zx", Version}))
|
||||
end.
|
||||
|
||||
start(LogPath) ->
|
||||
ok = logger:remove_handler(default),
|
||||
LogDir = filename:dirname(LogPath),
|
||||
ok = trim_logs(LogDir),
|
||||
@@ -992,10 +993,15 @@ run_dir(TargetDir, RunArgs) ->
|
||||
RunArgs :: [string()].
|
||||
|
||||
run_project(ProjectDir, ExecDir, RunArgs) ->
|
||||
{ok, Meta} = zx_lib:read_project_meta(),
|
||||
{ok, Dir} = file:get_cwd(),
|
||||
case zx_lib:read_project_meta() of
|
||||
{ok, Meta} -> run_project(ProjectDir, ExecDir, RunArgs, Meta);
|
||||
Error -> Error
|
||||
end.
|
||||
|
||||
run_project(ProjectDir, ExecDir, RunArgs, Meta) ->
|
||||
case pre_prep(Meta, RunArgs) of
|
||||
{Type, Deps, NewArgs} ->
|
||||
{ok, Dir} = file:get_cwd(),
|
||||
PackageID = {_, Name, _} = maps:get(package_id, Meta),
|
||||
true = os:putenv(Name ++ "_include", filename:join(Dir, "include")),
|
||||
case prepare(Deps) of
|
||||
@@ -9,7 +9,7 @@
|
||||
%%% @end
|
||||
|
||||
-module(zx_auth).
|
||||
-vsn("0.12.2").
|
||||
-vsn("0.12.3").
|
||||
-author("Craig Everett <zxq9@zxq9.com>").
|
||||
-copyright("Craig Everett <zxq9@zxq9.com>").
|
||||
-license("GPL-3.0").
|
||||
@@ -7,7 +7,7 @@
|
||||
%%% @end
|
||||
|
||||
-module(zx_conn).
|
||||
-vsn("0.12.2").
|
||||
-vsn("0.12.3").
|
||||
-author("Craig Everett <zxq9@zxq9.com>").
|
||||
-copyright("Craig Everett <zxq9@zxq9.com>").
|
||||
-license("GPL-3.0").
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
%%% @end
|
||||
|
||||
-module(zx_conn_sup).
|
||||
-vsn("0.12.2").
|
||||
-vsn("0.12.3").
|
||||
-behavior(supervisor).
|
||||
-author("Craig Everett <zxq9@zxq9.com>").
|
||||
-copyright("Craig Everett <zxq9@zxq9.com>").
|
||||
+1
-1
@@ -138,7 +138,7 @@
|
||||
%%% @end
|
||||
|
||||
-module(zx_daemon).
|
||||
-vsn("0.12.2").
|
||||
-vsn("0.12.3").
|
||||
-behavior(gen_server).
|
||||
-author("Craig Everett <zxq9@zxq9.com>").
|
||||
-copyright("Craig Everett <zxq9@zxq9.com>").
|
||||
@@ -8,7 +8,7 @@
|
||||
%%% @end
|
||||
|
||||
-module(zx_key).
|
||||
-vsn("0.12.2").
|
||||
-vsn("0.12.3").
|
||||
-author("Craig Everett <zxq9@zxq9.com>").
|
||||
-copyright("Craig Everett <zxq9@zxq9.com>").
|
||||
-license("GPL-3.0").
|
||||
@@ -10,7 +10,7 @@
|
||||
%%% @end
|
||||
|
||||
-module(zx_lib).
|
||||
-vsn("0.12.2").
|
||||
-vsn("0.12.3").
|
||||
-author("Craig Everett <zxq9@zxq9.com>").
|
||||
-copyright("Craig Everett <zxq9@zxq9.com>").
|
||||
-license("GPL-3.0").
|
||||
@@ -228,7 +228,7 @@ read_project_meta(Dir) ->
|
||||
Meta = maps:merge(zx_zsp:new_meta(), maps:from_list(Data)),
|
||||
{ok, Meta};
|
||||
{error, enoent} ->
|
||||
{error, "No project zomp.meta file. Wrong directory? Not initialized?", 2};
|
||||
{error, "No project zomp.meta file. Wrong directory? Not initialized?", 0};
|
||||
Error ->
|
||||
ok = log(error, "Read from zomp.meta failed with: ~tw", [Error]),
|
||||
Error
|
||||
@@ -6,7 +6,7 @@
|
||||
%%% @end
|
||||
|
||||
-module(zx_local).
|
||||
-vsn("0.12.2").
|
||||
-vsn("0.12.3").
|
||||
-author("Craig Everett <zxq9@zxq9.com>").
|
||||
-copyright("Craig Everett <zxq9@zxq9.com>").
|
||||
-license("GPL-3.0").
|
||||
@@ -5,7 +5,7 @@
|
||||
%%% @end
|
||||
|
||||
-module(zx_net).
|
||||
-vsn("0.12.2").
|
||||
-vsn("0.12.3").
|
||||
-author("Craig Everett <zxq9@zxq9.com>").
|
||||
-copyright("Craig Everett <zxq9@zxq9.com>").
|
||||
-license("GPL-3.0").
|
||||
@@ -8,7 +8,7 @@
|
||||
%%% @end
|
||||
|
||||
-module(zx_peer).
|
||||
-vsn("0.12.2").
|
||||
-vsn("0.12.3").
|
||||
-author("Craig Everett <zxq9@zxq9.com>").
|
||||
-copyright("Craig Everett <zxq9@zxq9.com>").
|
||||
-license("GPL-3.0").
|
||||
+1
-1
@@ -9,7 +9,7 @@
|
||||
%%% @end
|
||||
|
||||
-module(zx_peer_man).
|
||||
-vsn("0.12.2").
|
||||
-vsn("0.12.3").
|
||||
-behavior(gen_server).
|
||||
-author("Craig Everett <zxq9@zxq9.com>").
|
||||
-copyright("Craig Everett <zxq9@zxq9.com>").
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
%%% @end
|
||||
|
||||
-module(zx_peer_sup).
|
||||
-vsn("0.12.2").
|
||||
-vsn("0.12.3").
|
||||
-behaviour(supervisor).
|
||||
-author("Craig Everett <zxq9@zxq9.com>").
|
||||
-copyright("Craig Everett <zxq9@zxq9.com>").
|
||||
@@ -10,7 +10,7 @@
|
||||
%%% @end
|
||||
|
||||
-module(zx_peers).
|
||||
-vsn("0.12.2").
|
||||
-vsn("0.12.3").
|
||||
-behavior(supervisor).
|
||||
-author("Craig Everett <zxq9@zxq9.com>").
|
||||
-copyright("Craig Everett <zxq9@zxq9.com>").
|
||||
@@ -5,7 +5,7 @@
|
||||
%%% @end
|
||||
|
||||
-module(zx_proxy).
|
||||
-vsn("0.12.2").
|
||||
-vsn("0.12.3").
|
||||
-author("Craig Everett <zxq9@zxq9.com>").
|
||||
-copyright("Craig Everett <zxq9@zxq9.com>").
|
||||
-license("GPL-3.0").
|
||||
@@ -5,7 +5,7 @@
|
||||
%%% @end
|
||||
|
||||
-module(zx_sup).
|
||||
-vsn("0.12.2").
|
||||
-vsn("0.12.3").
|
||||
-behavior(supervisor).
|
||||
-author("Craig Everett <zxq9@zxq9.com>").
|
||||
-copyright("Craig Everett <zxq9@zxq9.com>").
|
||||
@@ -6,7 +6,7 @@
|
||||
%%% @end
|
||||
|
||||
-module(zx_tty).
|
||||
-vsn("0.12.2").
|
||||
-vsn("0.12.3").
|
||||
-author("Craig Everett <zxq9@zxq9.com>").
|
||||
-copyright("Craig Everett <zxq9@zxq9.com>").
|
||||
-license("GPL-3.0").
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
%%% @end
|
||||
|
||||
-module(zx_userconf).
|
||||
-vsn("0.12.2").
|
||||
-vsn("0.12.3").
|
||||
-author("Craig Everett <zxq9@zxq9.com>").
|
||||
-copyright("Craig Everett <zxq9@zxq9.com>").
|
||||
-license("GPL-3.0").
|
||||
@@ -7,7 +7,7 @@
|
||||
%%% @end
|
||||
|
||||
-module(zx_zsp).
|
||||
-vsn("0.12.2").
|
||||
-vsn("0.12.3").
|
||||
-author("Craig Everett <zxq9@zxq9.com>").
|
||||
-copyright("Craig Everett <zxq9@zxq9.com>").
|
||||
-license("GPL-3.0").
|
||||
@@ -9,7 +9,7 @@
|
||||
{license,"MIT"}.
|
||||
{modules,[]}.
|
||||
{name,"zx"}.
|
||||
{package_id,{"otpr","zx",{0,12,2}}}.
|
||||
{package_id,{"otpr","zx",{0,12,3}}}.
|
||||
{prefix,"zx_"}.
|
||||
{repo_url,"https://gitlab.com/zxq9/zx"}.
|
||||
{tags,["tools","package manager","erlang"]}.
|
||||
Reference in New Issue
Block a user