Skip to content

Instantly share code, notes, and snippets.

@nobrowser
Created October 12, 2017 05:08
Show Gist options
  • Save nobrowser/fa21da024c68fd8fdb577a0611445a6e to your computer and use it in GitHub Desktop.
Save nobrowser/fa21da024c68fd8fdb577a0611445a6e to your computer and use it in GitHub Desktop.
#! /bin/sh -Cefu
. /usr/local/bin/mashlib.sh
vconc OPAM $HOME /bin/opam
vconc REALPROG $HOME /.opam/ $($OPAM switch show) /bin/ocamlbuild
CURDIR=$PWD
while : ; do
if exists $PWD/_tags ; then break ; fi
case $PWD in
(/)
printf 'unable to find build directory\n' >&2
exit 1
;;
esac
cd ..
done
printf 'Entering directory %s%s%s\n' '`' $PWD "'"
set +e ; $REALPROG -classic-display "$@" ; STATUS=$? ; set -e
printf 'Leaving directory %s%s%s\n' '`' $PWD "'"
cd $CURDIR
exit $STATUS
@nobrowser
Copy link
Author

A wrapper script for ocamlbuild, to help emacs correlate error messages with its current directory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment