Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'master' of ssh://git.mochimedia.net//data/git/mochi/moc…

…hiweb
  • Loading branch information...
commit 8a8d28689469ebc0a56be224518a65977dcd4752 2 parents 953134d + 26579ca
David Reid authored
Showing with 15 additions and 3 deletions.
  1. +1 −1  Makefile
  2. +10 −0 scripts/new_mochiweb.erl
  3. +4 −2 src/mochiweb_skel.erl
View
2  Makefile
@@ -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)
View
10 scripts/new_mochiweb.erl 100644 → 100755
@@ -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().
View
6 src/mochiweb_skel.erl
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.