Skip to content

Commit

Permalink
error if path contains space
Browse files Browse the repository at this point in the history
  • Loading branch information
rjbou committed Jun 3, 2024
1 parent 0b25e87 commit 4be63e4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/client/opamClientConfig.ml
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,13 @@ let opam_init ?root_dir ?strict ?solver =

(* (i) get root dir *)
let root = OpamStateConfig.opamroot ?root_dir () in
if Sys.win32
(* if default, redirection will be handled by opam init, or should have
been handled *)
&& (root_dir <> None || OpamStateConfig.E.root () <> None)
&& OpamStd.String.contains_char (OpamFilename.Dir.to_string root) ' ' then
OpamConsole.error "You opam root directory contains a space, this may lead\
to several malfunction... bzzz.... nooo💥";

(* (ii) load conf file and set defaults *)
(* the init for OpamFormat is done in advance since (a) it has an effect on
Expand Down

0 comments on commit 4be63e4

Please sign in to comment.