Skip to content

Commit

Permalink
add include files to the archives
Browse files Browse the repository at this point in the history
  • Loading branch information
Ulf Wiger committed Apr 5, 2011
1 parent 5d96588 commit 6dafbb3
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
Binary file modified run_eqc.ez
Binary file not shown.
Binary file modified run_proper.ez
Binary file not shown.
25 changes: 18 additions & 7 deletions src/run_eqc_gen.erl
Expand Up @@ -4,14 +4,10 @@

main([Archive, QC, Which]) when Which=="proper"; Which=="eqc" ->
QCPath = Which ++ "/" ++ "ebin" ++ "/",
QCIncl = Which ++ "/" ++ "include" ++ "/",
QCFiles =
filelib:fold_files(
QC, "\\.beam\$", false,
fun(F, Acc) ->
{ok, Bin} = file:read_file(F),
FN = QCPath ++ filename:basename(F),
[{FN, Bin}|Acc]
end, []),
fold_files(join(QC,"include"), QCIncl) ++
fold_files(join(QC,"ebin"), QCPath),
MyPath = filename:dirname(code:which(?MODULE)),
MainMod = case Which of
"eqc" ->
Expand All @@ -23,3 +19,18 @@ main([Archive, QC, Which]) when Which=="proper"; Which=="eqc" ->
ZipName = "run_eqc/ebin/" ++ filename:basename(MainMod),
zip:create(Archive, [{ZipName, Bin}
| QCFiles]).

file_bin(F) ->
{ok, B} = file:read_file(F),
B.

fold_files(D, Path) ->
filelib:fold_files(
D, ".*", false,
fun(F, Acc) ->
FN = Path ++ filename:basename(F),
[{FN, file_bin(F)}|Acc]
end, []).

join(A, B) ->
filename:join(A, B).

0 comments on commit 6dafbb3

Please sign in to comment.