Runtime checks
- Check for presence of WX when running a GUI app - Ensure current Erlang runtime matches bytecode on Linux
This commit is contained in:
@@ -1 +1 @@
|
||||
0.12.5
|
||||
0.12.6
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{application,zx,
|
||||
[{description,"An Erlang development tool and Zomp user client"},
|
||||
{vsn,"0.12.5"},
|
||||
{vsn,"0.12.6"},
|
||||
{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.5").
|
||||
-vsn("0.12.6").
|
||||
-behavior(application).
|
||||
-author("Craig Everett <zxq9@zxq9.com>").
|
||||
-copyright("Craig Everett <zxq9@zxq9.com>").
|
||||
@@ -1173,11 +1173,11 @@ fetch2(ID) ->
|
||||
%% Gets all the target application's ducks in a row and launches them, then enters
|
||||
%% the exec_wait/1 loop to wait for any queries from the application.
|
||||
|
||||
execute(lib, PackageID, _, _, _) ->
|
||||
Message = "Lib ~ts is available on the system, but is not a standalone app.",
|
||||
{ok, PackageString} = zx_lib:package_string(PackageID),
|
||||
ok = tell(Message, [PackageString]),
|
||||
init:stop();
|
||||
execute(gui, PackageID, Meta, Dir, RunArgs) ->
|
||||
case wx_available() of
|
||||
true -> execute(PackageID, Meta, Dir, RunArgs);
|
||||
false -> {error, "WX (GUI system) is not found. Aborting."}
|
||||
end;
|
||||
execute(cli, PackageID, Meta, Dir, RunArgs) ->
|
||||
Name = element(2, PackageID),
|
||||
ok = zx_daemon:pass_meta(Meta, Dir, RunArgs),
|
||||
@@ -1190,15 +1190,32 @@ execute(cli, PackageID, Meta, Dir, RunArgs) ->
|
||||
Mod = list_to_atom(ModName),
|
||||
Mod:start(RunArgs)
|
||||
end;
|
||||
execute(Type, PackageID, Meta, Dir, RunArgs) ->
|
||||
execute(app, PackageID, Meta, Dir, RunArgs) ->
|
||||
execute(PackageID, Meta, Dir, RunArgs);
|
||||
execute(lib, PackageID, _, _, _) ->
|
||||
Message = "Lib ~ts is available on the system, but is not a standalone app.",
|
||||
{ok, PackageString} = zx_lib:package_string(PackageID),
|
||||
ok = tell("Starting ~p ~ts.", [Type, PackageString]),
|
||||
ok = tell(Message, [PackageString]),
|
||||
init:stop().
|
||||
|
||||
execute(PackageID, Meta, Dir, RunArgs) ->
|
||||
{ok, PackageString} = zx_lib:package_string(PackageID),
|
||||
ok = tell("Starting ~ts.", [PackageString]),
|
||||
Name = element(2, PackageID),
|
||||
ok = zx_daemon:pass_meta(Meta, Dir, RunArgs),
|
||||
AppTag = list_to_atom(Name),
|
||||
ok = ensure_all_started(AppTag, permanent),
|
||||
log(info, "Launcher complete.").
|
||||
|
||||
wx_available() ->
|
||||
try
|
||||
_ = wx:null(),
|
||||
true
|
||||
catch
|
||||
error:undef ->
|
||||
false
|
||||
end.
|
||||
|
||||
|
||||
-spec ensure_all_started(AppMod, Type) -> ok
|
||||
when AppMod :: module(),
|
||||
@@ -9,7 +9,7 @@
|
||||
%%% @end
|
||||
|
||||
-module(zx_auth).
|
||||
-vsn("0.12.5").
|
||||
-vsn("0.12.6").
|
||||
-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.5").
|
||||
-vsn("0.12.6").
|
||||
-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.5").
|
||||
-vsn("0.12.6").
|
||||
-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.5").
|
||||
-vsn("0.12.6").
|
||||
-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.5").
|
||||
-vsn("0.12.6").
|
||||
-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.5").
|
||||
-vsn("0.12.6").
|
||||
-author("Craig Everett <zxq9@zxq9.com>").
|
||||
-copyright("Craig Everett <zxq9@zxq9.com>").
|
||||
-license("GPL-3.0").
|
||||
@@ -6,7 +6,7 @@
|
||||
%%% @end
|
||||
|
||||
-module(zx_local).
|
||||
-vsn("0.12.5").
|
||||
-vsn("0.12.6").
|
||||
-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.5").
|
||||
-vsn("0.12.6").
|
||||
-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.5").
|
||||
-vsn("0.12.6").
|
||||
-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.5").
|
||||
-vsn("0.12.6").
|
||||
-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.5").
|
||||
-vsn("0.12.6").
|
||||
-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.5").
|
||||
-vsn("0.12.6").
|
||||
-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.5").
|
||||
-vsn("0.12.6").
|
||||
-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.5").
|
||||
-vsn("0.12.6").
|
||||
-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.5").
|
||||
-vsn("0.12.6").
|
||||
-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.5").
|
||||
-vsn("0.12.6").
|
||||
-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.5").
|
||||
-vsn("0.12.6").
|
||||
-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,5}}}.
|
||||
{package_id,{"otpr","zx",{0,12,6}}}.
|
||||
{prefix,"zx_"}.
|
||||
{repo_url,"https://gitlab.com/zxq9/zx"}.
|
||||
{tags,["tools","package manager","erlang"]}.
|
||||
Reference in New Issue
Block a user