From 1c6a01664463452edb9d1d83e4e291e4ff9071f3 Mon Sep 17 00:00:00 2001 From: Sebastian Wiesner Date: Mon, 14 Oct 2013 11:12:34 +0200 Subject: [PATCH] Add Ocaml module Manage local Ocaml modules with OPAM. Signed-off-by: Sorin Ionescu --- modules/README.md | 5 +++++ modules/ocaml/README.md | 28 ++++++++++++++++++++++++++++ modules/ocaml/init.zsh | 15 +++++++++++++++ 3 files changed, 48 insertions(+) create mode 100644 modules/ocaml/README.md create mode 100644 modules/ocaml/init.zsh diff --git a/modules/README.md b/modules/README.md index 63484e4..3886dfc 100644 --- a/modules/README.md +++ b/modules/README.md @@ -86,6 +86,11 @@ Node.js Provides utility functions for Node.js and loads npm completion. +Ocaml +----- + +Initializes Ocaml package management. + OSX --- diff --git a/modules/ocaml/README.md b/modules/ocaml/README.md new file mode 100644 index 0000000..7d56fec --- /dev/null +++ b/modules/ocaml/README.md @@ -0,0 +1,28 @@ +Ocaml +===== + +Initializes [Ocaml][1] package management. + +OPAM +---- + +[OPAM][2] is a package manager for Ocaml. + +This module enables local package installation with OPAM by extending the +relevant path and Ocaml variables. + +### Usage + +Install packages to your local package directory with `opam install`. + +Authors +------- + +*The authors of this module should be contacted via the [issue tracker][3].* + + - [Sebastian Wiesner](https://github.com/lunaryorn) + +[1]: http://ocaml.org/ +[2]: http://opam.ocamlpro.com/ +[3]: https://github.com/sorin-ionescu/prezto/issues + diff --git a/modules/ocaml/init.zsh b/modules/ocaml/init.zsh new file mode 100644 index 0000000..2e5b71e --- /dev/null +++ b/modules/ocaml/init.zsh @@ -0,0 +1,15 @@ +# +# Initializes Ocaml package management. +# +# Authors: +# Sebastian Wiesner +# + +# Return if requirements are not found. +if (( ! $+commands[opam] )); then + return 1 +fi + +# Initialize OPAM. +eval "$(opam config env)" +