Permalink
Browse files

fix beepbeep_skel.erl to make syslink on win correctly

  • Loading branch information...
1 parent 5c6623d commit 5e7f2fef9e376ee3e4f5a2b244c7080ee82b22b0 strobe committed Oct 26, 2010
Showing with 11 additions and 10 deletions.
  1. +1 −0 src/beepbeep_args.erl
  2. +10 −10 src/beepbeep_skel.erl
View
1 src/beepbeep_args.erl
@@ -34,6 +34,7 @@
%% @doc Return the Path
%%
path(Env) ->
+ok,
proplists:get_value("PATH_INFO",Env).
%%
View
20 src/beepbeep_skel.erl
@@ -22,10 +22,10 @@ skelcopy(DestDir, InName) ->
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);
+ mk_win_dir_syslink(Name, "beepbeep-src", DestDir, Cwd ++ "/../"),
+ mk_win_dir_syslink(Name, "erlydtl-src", DestDir, Cwd ++ "/../deps/erlydtl"),
+ mk_win_dir_syslink(Name, "mochiweb-src", DestDir, Cwd ++ "/../deps/mochiweb"),
+ mk_bat_file(Name, DestDir);
{unix,_} ->
ok = file:make_symlink(
filename:join(filename:dirname(code:which(?MODULE)), ".."),
@@ -41,20 +41,20 @@ skelcopy(DestDir, InName) ->
%% Internal API
%% @doc Make symbolik link in current directory on windows vista or highter
-mk_win_dir_syslink(ProjectName, LinkName,DestLink) ->
-% io:format("~nname:~p~ntarget:~p~n~n", [LinkName, DestLink]),
- S = (list_to_atom("cd "++ ProjectName ++ "//deps" ++ "& mklink /D " ++ LinkName ++ " " ++ "\"" ++ DestLink ++ "\"")),
-% io:format("~n~p~n", [S]),
+mk_win_dir_syslink(ProjectName, LinkName, DestDir, LinkTarget) ->
+ S = (list_to_atom("cd "++ filename:join([DestDir, ProjectName, "deps"]) ++ "& mklink /D " ++ LinkName ++ " \"" ++ LinkTarget ++ "\"")),
os:cmd(S),
+ %io:format("~nname:~p~ntarget:~p~n~n", [LinkName, DestTarget]),
+ %io:format("~n~p~n", [S]),
ok.
%% @doc make .bat file to start dev server on windows
-mk_bat_file(ProjectName, Cwd) ->
+mk_bat_file(ProjectName, DestDir) ->
Name = "start-server.bat",
Content = "make \n"
"start werl -pa ebin deps/*/ebin -boot start_sasl -s " ++ ProjectName ++ " -s \n"
"reloader ",
- file:set_cwd(Cwd ++ "//" ++ ProjectName),
+ file:set_cwd(DestDir ++ "//" ++ ProjectName),
{ok, IODevice} = file:open(Name, [write]), file:write(IODevice, Content), file:close(IODevice),
ok.

0 comments on commit 5e7f2fe

Please sign in to comment.