Skip to content

Commit 12c18ae

Browse files
authored
Fix failure to parse git tag date in psc-publish (purescript#2613)
Fixes one of the problems mentioned in purescript#2610.
1 parent ada063f commit 12c18ae

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Language/PureScript/Publish.hs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,9 @@ getVersionFromGitTag = do
195195
getTagTime :: Text -> PrepareM UTCTime
196196
getTagTime tag = do
197197
out <- readProcess' "git" ["show", T.unpack tag, "--no-patch", "--format=%aI"] ""
198-
let time = headMay (lines out) >>= D.parseTime
199-
maybe (internalError (CouldntParseGitTagDate tag)) pure time
198+
case mapMaybe D.parseTime (lines out) of
199+
[t] -> pure t
200+
_ -> internalError (CouldntParseGitTagDate tag)
200201

201202
getBowerRepositoryInfo :: PackageMeta -> PrepareM (D.GithubUser, D.GithubRepo)
202203
getBowerRepositoryInfo = either (userError . BadRepositoryField) return . tryExtract

0 commit comments

Comments
 (0)