0.12.3: Correct launch optimization, fix local file deletion bug on failed run start.
This commit is contained in:
parent
01884f3bd4
commit
26a2a0fe5d
10
:
Normal file
10
:
Normal file
@ -0,0 +1,10 @@
|
||||
Ensure paths are set for local libs
|
||||
# Please enter the commit message for your changes. Lines starting
|
||||
# with '#' will be ignored, and an empty message aborts the commit.
|
||||
#
|
||||
# ブランチ master
|
||||
# Your branch is up to date with 'origin/master'.
|
||||
#
|
||||
# コミット予定の変更点:
|
||||
# modified: zomp/lib/otpr/zx/0.12.2/src/zx.erl
|
||||
#
|
||||
@ -3,7 +3,7 @@
|
||||
# A convenience script that will download the ZX installer, unpack it, and clean up.
|
||||
# For maximum portability this script uses the gzipped package version.
|
||||
|
||||
version=0.11.6
|
||||
version=0.12.3
|
||||
zx="zx-$version"
|
||||
tarball="$zx.tar.gz"
|
||||
|
||||
|
||||
2
unix/zx
2
unix/zx
@ -11,7 +11,7 @@ export ZX_DIR="$ZOMP_DIR/lib/otpr/zx/$ZX_VERSION"
|
||||
|
||||
start_dir="$PWD"
|
||||
cd "$ZX_DIR"
|
||||
if [ ! -f ebin/zx.erl ]
|
||||
if [ ! -f ebin/zx.beam ]
|
||||
then
|
||||
chmod +x make_zx
|
||||
./make_zx
|
||||
|
||||
2
unix/zxh
2
unix/zxh
@ -11,7 +11,7 @@ export ZX_DIR="$ZOMP_DIR/lib/otpr/zx/$ZX_VERSION"
|
||||
|
||||
start_dir="$PWD"
|
||||
cd "$ZX_DIR"
|
||||
if [ ! -f ebin/zx.erl ]
|
||||
if [ ! -f ebin/zx.beam ]
|
||||
then
|
||||
chmod +x make_zx
|
||||
./make_zx
|
||||
|
||||
@ -1 +1 @@
|
||||
0.12.1
|
||||
0.12.3
|
||||
|
||||
@ -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);
|
||||
{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 := PackageID}} -> zx_lib:new_logpath(PackageID);
|
||||
{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 := PackageID}} -> zx_lib:new_logpath(PackageID);
|
||||
{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")),
|
||||
zx_lib:new_logpath({"otpr", "zx", Version})
|
||||
end,
|
||||
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").
|
||||
@ -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>").
|
||||
@ -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").
|
||||
@ -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>").
|
||||
@ -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").
|
||||
@ -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"]}.
|
||||
Loading…
x
Reference in New Issue
Block a user