Skip to content
Browse files

Ensure --packager-config file exists and make the path absolute.

  • Loading branch information...
1 parent a837f84 commit 63b073c8feeda6f8286d51693ca2b9b3d4d02757 @rwmjones rwmjones committed
Showing with 13 additions and 2 deletions.
  1. +13 −2 src/febootstrap_cmdline.ml
View
15 src/febootstrap_cmdline.ml
@@ -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,

0 comments on commit 63b073c

Please sign in to comment.
Something went wrong with that request. Please try again.