Permalink
Browse files

edit beepbeep_skel.erl, make changes to create syslink on win and lin…

…ux simultaneously
  • Loading branch information...
1 parent 155b811 commit 5c6623db3384e1d063e064f26f7455e6fd3a5667 strobe committed Oct 25, 2010
Showing with 18 additions and 17 deletions.
  1. BIN doc/erlang.png
  2. +18 −17 src/beepbeep_skel.erl
View
Deleted file not rendered
View
@@ -19,23 +19,24 @@ skelcopy(DestDir, InName) ->
end,
skelcopy(src(), DestDir, Name, LDst),
%
- {ok, Cwd} = file:get_cwd(),
- mk_win_dir_syslink(Name, "beepbeep-src", Cwd ++ "/../"),
- mk_win_dir_syslink(Name, "erlydtl-src", Cwd ++ "/../deps/erlydtl"),
- mk_win_dir_syslink(Name, "mochiweb-src", Cwd ++ "/../deps/mochiweb"),
- mk_bat_file(Name, Cwd).
-
-% ok = file:make_symlink(
-% filename:join(filename:dirname(code:which(?MODULE)), ".."),
-% filename:join([DestDir, Name, "deps", "beepbeep-src"])),
-% ok = file:make_symlink(
-% filename:join(filename:dirname(code:which(?MODULE)), "../deps/erlydtl"),
-% filename:join([DestDir, Name, "deps", "erlydtl-src"])),
-% ok = file:make_symlink(
-% filename:join(filename:dirname(code:which(?MODULE)), "../deps/mochiweb"),
-% filename:join([DestDir, Name, "deps", "mochiweb-src"])).
-
-
+ case os:type() of
+ {win32,_} ->
+ {ok, Cwd} = file:get_cwd(),
+ mk_win_dir_syslink(Name, "beepbeep-src", Cwd ++ "/../"),
+ mk_win_dir_syslink(Name, "erlydtl-src", Cwd ++ "/../deps/erlydtl"),
+ mk_win_dir_syslink(Name, "mochiweb-src", Cwd ++ "/../deps/mochiweb"),
+ mk_bat_file(Name, Cwd);
+ {unix,_} ->
+ ok = file:make_symlink(
+ filename:join(filename:dirname(code:which(?MODULE)), ".."),
+ filename:join([DestDir, Name, "deps", "beepbeep-src"])),
+ ok = file:make_symlink(
+ filename:join(filename:dirname(code:which(?MODULE)), "../deps/erlydtl"),
+ filename:join([DestDir, Name, "deps", "erlydtl-src"])),
+ ok = file:make_symlink(
+ filename:join(filename:dirname(code:which(?MODULE)), "../deps/mochiweb"),
+ filename:join([DestDir, Name, "deps", "mochiweb-src"]))
+ end.
%% Internal API

0 comments on commit 5c6623d

Please sign in to comment.