Skip to content

Commit

Permalink
Merge branch 'master' of ssh://git.mochimedia.net//data/git/mochi/moc…
Browse files Browse the repository at this point in the history
…hiweb
  • Loading branch information
David Reid committed Jul 2, 2010
2 parents 953134d + 26579ca commit 8a8d286
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -8,7 +8,7 @@ test: ebin/
(cd src;$(MAKE) test)

clean:
(cd src;$(MAKE) clean)
rm -rf ebin

clean_plt:
(cd src;$(MAKE) clean_plt)
Expand Down
10 changes: 10 additions & 0 deletions scripts/new_mochiweb.erl 100644 → 100755
Expand Up @@ -9,6 +9,16 @@ main([Name]) ->
main([Name, Dest]) ->
ensure(),
DestDir = filename:absname(Dest),
case code:which(mochiweb_skel) of
non_existing ->
io:format("mochiweb not compiled, running make~n"),
os:cmd("(cd \"" ++ filename:dirname(escript:script_name())
++ "/..\"; make)"),
ensure(),
code:rehash();
_ ->
ok
end,
ok = mochiweb_skel:skelcopy(DestDir, Name);
main(_) ->
usage().
Expand Down
6 changes: 4 additions & 2 deletions src/mochiweb_skel.erl
Expand Up @@ -14,9 +14,11 @@ skelcopy(DestDir, Name) ->
N + 1
end,
skelcopy(src(), DestDir, Name, LDst),
DestLink = filename:join([DestDir, Name, "deps", "mochiweb-src"]),
ok = filelib:ensure_dir(DestLink),
ok = file:make_symlink(
filename:join(filename:dirname(code:which(?MODULE)), ".."),
filename:join([DestDir, Name, "deps", "mochiweb-src"])).
filename:join(filename:dirname(code:which(?MODULE)), ".."),
DestLink).

%% Internal API

Expand Down

0 comments on commit 8a8d286

Please sign in to comment.