on master help sign in
Merge pull request #218 from obsidiansystems/ob-run-default-extensions-no-extensions-fix

Fix ghci warning/info when no default-extensions are present

commit3c3427218cb67f094a3cb82cff5a550d522dd416 authorLuigy Leon <luichi.19@gmail.com> dateWed 19 Sep 2018, 16:33 (8 years ago) parente66051eedd06f0
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"