Fix --file option (#1004)

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).
This commit is contained in:
Gabriel Gonzalez 2019-06-14 08:50:37 -07:00 committed by GitHub
parent 154d1c52cf
commit 53f5fa158e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 =