From 40742154f0ac6731b786bad77fb20b0a8fcea326 Mon Sep 17 00:00:00 2001 From: Vanessa McHale Date: Wed, 25 Jul 2018 12:05:34 -0500 Subject: [PATCH] release --- ats-pkg/ats-pkg.cabal | 2 +- ats-pkg/src/Language/ATS/Package/Build.hs | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/ats-pkg/ats-pkg.cabal b/ats-pkg/ats-pkg.cabal index 6b417c46..36cac373 100644 --- a/ats-pkg/ats-pkg.cabal +++ b/ats-pkg/ats-pkg.cabal @@ -1,6 +1,6 @@ cabal-version: 2.0 name: ats-pkg -version: 3.1.0.0 +version: 3.1.0.1 license: BSD3 license-file: LICENSE copyright: Copyright: (c) 2018 Vanessa McHale diff --git a/ats-pkg/src/Language/ATS/Package/Build.hs b/ats-pkg/src/Language/ATS/Package/Build.hs index 50923c7f..116406a5 100644 --- a/ats-pkg/src/Language/ATS/Package/Build.hs +++ b/ats-pkg/src/Language/ATS/Package/Build.hs @@ -202,9 +202,17 @@ mkPkg mStr rba lint tim setup rs tgt v = do mkConfig :: Maybe String -> Rules () mkConfig mStr = do - (".atspkg" "args") %> \out -> - alwaysRerun >> - liftIO (BSL.writeFile out (encode mStr)) + (".atspkg" "args") %> \out -> do + alwaysRerun + shouldWrite <- do + exists <- liftIO (doesFileExist out) + contents <- if exists + then liftIO (BSL.readFile out) + else pure mempty + pure $ BSL.length contents /= 0 && encode mStr /= contents + if shouldWrite + then liftIO (BSL.writeFile out (encode mStr)) + else mempty (".atspkg" "config") %> \out -> do need ["atspkg.dhall", ".atspkg" "args"]