Skip to content

Commit

Permalink
release
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessa McHale committed Jul 30, 2018
1 parent 7a08784 commit 3e0fc91
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion ats-pkg/ats-pkg.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 2.0
name: ats-pkg
version: 3.1.0.5
version: 3.1.0.6
license: BSD3
license-file: LICENSE
copyright: Copyright: (c) 2018 Vanessa McHale
Expand Down
9 changes: 6 additions & 3 deletions ats-pkg/src/Language/ATS/Package/Build.hs
Original file line number Diff line number Diff line change
Expand Up @@ -117,16 +117,19 @@ mkManpage mStr = do
-- cfgFile :: FilePath
-- cfgFile = ".atspkg" </> "config"

parens :: String -> String
parens s = mconcat [ "(", s, ")" ]

-- FIXME this doesn't rebuild when it should; it should rebuild when
-- @atspkg.dhall@ changes.
getConfig :: MonadIO m => Maybe String -> Maybe FilePath -> m Pkg
getConfig mStr dir' = liftIO $ do
d <- fromMaybe <$> fmap (</> "atspkg.dhall") getCurrentDirectory <*> pure dir'
b <- not <$> doesFileExist (".atspkg" </> "config")
let strMod = maybe id (\s -> (<> (" " <> s))) mStr
let go = case mStr of { Just x -> (<> (" " <> parens x)) ; Nothing -> id }
b' <- shouldWrite mStr (".atspkg" </> "args")
if b || b'
then input auto (T.pack (strMod d))
then input auto (T.pack (go d))
else fmap (decode . BSL.fromStrict) . BS.readFile $ ".atspkg" </> "config"

manTarget :: Text -> FilePath
Expand Down Expand Up @@ -217,7 +220,7 @@ mkConfig mStr = do

(".atspkg" </> "config") %> \out -> do
need ["atspkg.dhall", args]
let go = case mStr of { Just x -> (<> (" " <> x)) ; Nothing -> id }
let go = case mStr of { Just x -> (<> (" " <> parens x)) ; Nothing -> id }
x <- liftIO $ input auto (T.pack (go "./atspkg.dhall"))
liftIO $ BSL.writeFile out (encode (x :: Pkg))

Expand Down

0 comments on commit 3e0fc91

Please sign in to comment.