Skip to content

Commit

Permalink
Add a '.ocamlinit' that runs a toplevel with the current switch loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
AltGr committed Dec 22, 2016
1 parent 63ca993 commit d4f269d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .ocamlinit
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#use "topfind";;
#require "opam-client";;

OpamClientConfig.opam_init ();;

let gt = OpamGlobalState.load `Lock_none;;
OpamConsole.msg "Opam global state for %s loaded in 'gt'\n"
OpamStateConfig.(OpamFilename.Dir.to_string !r.root_dir);;
let rt = OpamRepositoryState.load `Lock_none gt;;
OpamConsole.msg "Opam repository state loaded in 'rt'\n";;
let st = OpamSwitchState.load `Lock_none gt rt (OpamStateConfig.get_switch ());;
OpamConsole.msg "Opam switch state of '%s' loaded in 'st'\n"
(OpamSwitch.to_string (OpamStateConfig.get_switch ()));;

0 comments on commit d4f269d

Please sign in to comment.