if stack packages missing assume it is ["."]

This commit is contained in:
Nick Dunets 2020-07-08 16:40:54 +12:00
parent eb606df6c3
commit a269f57448

View File

@ -31,7 +31,7 @@ newtype Pkgs = Pkgs [FilePath]
deriving (Eq, Ord)
instance FromJSON Pkgs where
parseJSON (Object v) = Pkgs <$> v .: "packages"
parseJSON (Object v) = Pkgs <$> v .:? "packages" .!= ["."]
parseJSON _ = fail "could not read packages from stack.yaml"
stackYamlPkgs :: FilePath -> MaybeT IO [FilePath]