on master help sign in
Fix ghci warning/info when no default-extensions are present
commitedd06f0960e885f99cab9544cdfc9dc8182595e6 authorKen Micklas <kmicklas@gmail.com> dateWed 19 Sep 2018, 16:29 (8 years ago) parente66051e
1 file changed+5−2
lib/command/src/Obelisk/Command/Run.hs+5−2
lib/command/src/Obelisk/Command/Run.hs+5−2
@@ -118,9 +118,12 @@ withGhciScript pkgs f = do
118118 putLog Warning $ T.pack $ "Failed to find pkgs in " <> intercalate ", " pkgDirErrs
119119
120120 let extensions = packageInfos >>= _cabalPackageInfo_defaultExtensions
121− dotGhci = unlines
121+ extensionsLine = if extensions == mempty
122+ then ""
123+ else ":set " <> intercalate " " ((("-X" <>) . prettyShow) <$> extensions)
124+ dotGhci = unlines $
122125 [ ":set -i" <> intercalate ":" (packageInfos >>= rootedSourceDirs)
123− , ":set " <> intercalate " " ((("-X" <>) . prettyShow) <$> extensions)
126+ , extensionsLine
124127 , ":load Backend Frontend"
125128 , "import Obelisk.Run"
126129 , "import qualified Frontend"