forked from ocaml/opam
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a '.ocamlinit' that runs a toplevel with the current switch loaded
- Loading branch information
Showing
1 changed file
with
13 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 ()));; |