Skip to content
This repository has been archived by the owner on May 13, 2019. It is now read-only.

Commit

Permalink
mkdir_p fixed: current directory is the same before and after functio…
Browse files Browse the repository at this point in the history
…n call

Updated makorel version number to 0.2.1.
  • Loading branch information
sagotch committed May 30, 2014
1 parent 38892e7 commit 234aca6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions makorel.ml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ let init root_dir version =
Pervasives.close_out out in
let dir = root_dir ^ "/" ^ package_name ^ "." ^ version in
mkdir_p dir;
write_file (dir ^ "/descr") "No description yet.\n";
write_file (dir ^ "/descr") (package_name ^ " - No description yet.\n");
write_file (dir ^ "/opam") opam_items;
write_file (dir ^ "/url") url_items

Expand Down Expand Up @@ -148,7 +148,7 @@ let upgrade root_dir new_ver =
(* main function *)
let _ =

let makorel_version = "0.2.0" in
let makorel_version = "0.2.1" in

let create = ref false in
let version = ref "" in
Expand Down
4 changes: 3 additions & 1 deletion unixx.ml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ let mkdir_p path =
(* FIXME: absolute are parsed as relatives (first / is removed by splitting) *)
(* FIXME: "my\/bad\/path/" will be splitted as ["my"; "bad"; "path"]
* instead of ["my\/bad\/path"]*)
let initial_dir = Sys.getcwd () in
path
|> Str.split (Str.regexp "/")
|> List.iter
Expand All @@ -63,4 +64,5 @@ let mkdir_p path =
else if not (Sys.is_directory dst)
then failwith (dst ^ " already exists and is a file");
Sys.chdir dst
end
end;
Sys.chdir initial_dir

0 comments on commit 234aca6

Please # to comment.