From 47c5dd7c76cebc12b8f44d0a62120e74ea424142 Mon Sep 17 00:00:00 2001 From: Gabriel Gonzalez Date: Tue, 11 Jun 2019 08:37:02 -0700 Subject: [PATCH] Fix `--file` option The `--file` option was essentially broken since it passed in the file path instead of the directory, meaning that transitive imports would not be computed correctly (they'd be off by one path component). --- dhall/src/Dhall/Main.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dhall/src/Dhall/Main.hs b/dhall/src/Dhall/Main.hs index 15f05a371..6be10b1a2 100644 --- a/dhall/src/Dhall/Main.hs +++ b/dhall/src/Dhall/Main.hs @@ -70,6 +70,7 @@ import qualified Options.Applicative import qualified Paths_dhall as Meta import qualified System.Console.ANSI import qualified System.IO +import qualified System.FilePath import qualified Text.Dot import qualified Data.Map @@ -299,7 +300,7 @@ command (Options {..}) = do where file = case maybeFile of Just "-" -> "." - Just f -> f + Just f -> System.FilePath.takeDirectory f Nothing -> "." let handle =