Skip to content

Commit

Permalink
Fix ocaml#270
Browse files Browse the repository at this point in the history
Catch the exception if $HOME is not defined.
  • Loading branch information
samoht committed Nov 7, 2012
1 parent 38d2f72 commit 8eba6ab
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/core/opamGlobals.ml
Expand Up @@ -41,7 +41,10 @@ let switch : string option ref = ref None

let opam_version = "1"

let home = Unix.getenv "HOME"
let home =
try Unix.getenv "HOME"
with _ -> Unix.getcwd ()

let default_opam_dir = Filename.concat home ".opam"

let root_dir = ref default_opam_dir
Expand Down

0 comments on commit 8eba6ab

Please sign in to comment.