Skip to content

Commit

Permalink
Ensure --packager-config file exists and make the path absolute.
Browse files Browse the repository at this point in the history
  • Loading branch information
rwmjones committed Dec 22, 2012
1 parent a837f84 commit 63b073c
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/febootstrap_cmdline.ml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,19 @@ let print_version () =
let add_exclude re =
excludes := Str.regexp re :: !excludes

let set_packager_config str =
packager_config := Some str
let set_packager_config filename =
(* Need to check that the file exists, and make the path absolute. *)
let filename =
if Filename.is_relative filename then
Filename.concat (Sys.getcwd ()) filename
else filename in
if not (Sys.file_exists filename) then (
eprintf "febootstrap: --packager-config: %s: file does not exist\n"
filename;
exit 1
);

packager_config := Some filename

let argspec = Arg.align [
"--exclude", Arg.String add_exclude,
Expand Down

0 comments on commit 63b073c

Please sign in to comment.