Apache-2.0 licensed by Tweag I/O Limited
Maintained by [email protected]
This version can be pinned in stack with:bazel-runfiles-0.12@sha256:ea0e555a0c3fa67b0009a5f97d72cb1a0e9f03fe20ee2f6025b49a8117537298,1414

Module documentation for 0.12

Used by 1 package in nightly-2022-08-02(full list with versions):

Bazel Runfiles

This is a small utility to enable discovery of the Bazel runfiles location. This is useful in tests for example.

module Main (main) where

import qualified Bazel.Runfiles as Runfiles
import Control.Monad (when)
import System.Process (callProcess)

main :: IO ()
main = do
    r <- Runfiles.create
    foo <- readFile (Runfiles.rlocation r "rules_haskell/tools/runfiles/test-data.txt")
    when (lines foo /= ["foo"]) -- ignore trailing newline
        $ error $ "Incorrect contents: got: " ++ show foo
    callProcess (Runfiles.rlocation r "rules_haskell/tools/runfiles/bin") []