Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support ansi-terminal-1.0.2 #123

Merged
merged 1 commit into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog for pantry

## v0.9.3.2

* Support `ansi-terminal-1.0.2`.

## v0.9.3.1

* Depend on `aeson-warning-parser-0.1.1`.
Expand Down
2 changes: 1 addition & 1 deletion package.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: pantry
version: 0.9.3.1
version: 0.9.3.2
synopsis: Content addressable Haskell package management
description: Please see the README on GitHub at <https://github.com/commercialhaskell/pantry#readme>
category: Development
Expand Down
2 changes: 1 addition & 1 deletion pantry.cabal

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 11 additions & 1 deletion src/Pantry/Repo.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE CPP #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
Expand Down Expand Up @@ -43,7 +44,11 @@ import RIO.Process
, withWorkingDir
)
import qualified RIO.Text as T
#if MIN_VERSION_ansi_terminal(1, 0, 2)
import System.Console.ANSI ( hNowSupportsANSI )
#else
import System.Console.ANSI ( hSupportsANSIWithoutEmulation )
#endif
import System.IsWindows ( osIsWindows )

data TarType = Gnu | Bsd
Expand Down Expand Up @@ -311,7 +316,12 @@ withRepo sr@SimpleRepo{..} action =
-- that command clears, but does not then restore, the
-- ENABLE_VIRTUAL_TERMINAL_PROCESSING flag for native terminals. The
-- following hack re-enables the lost ANSI-capability.
when osIsWindows $ void $ liftIO $ hSupportsANSIWithoutEmulation stdout
when osIsWindows $ void $ liftIO $
#if MIN_VERSION_ansi_terminal(1, 0, 2)
hNowSupportsANSI stdout
#else
hSupportsANSIWithoutEmulation stdout
#endif
logInfo $ "Cloning " <> display sRepoCommit <> " from " <> display sRepoUrl
runCommand ["clone", repoUrl, dir]
fixANSIForWindows
Expand Down
7 changes: 1 addition & 6 deletions stack-ghc-9.6.3.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
# Snapshot specification for GHC 9.6.3.
resolver: lts-22.4 # GHC 9.6.3

packages:
# lts-22.4 provides tar-conduit-0.4.0
- tar-conduit-0.4.1@sha256:112d28118eb71901ea9e224e1b174c648b378256729669c2739b8b803d25b43a,3126

resolver: lts-22.6 # GHC 9.6.3

flags:
hackage-security:
Expand Down
4 changes: 1 addition & 3 deletions stack-ghc-9.8.1.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
# Snapshot specification for GHC 9.8.1.
resolver: nightly-2024-01-06 # GHC 9.8.1
resolver: nightly-2024-01-17 # GHC 9.8.1

packages:
- hedgehog-1.4@sha256:47633efec27b49fe5a21d51f3b9fce428ca4b945d39eaa163b2b6a1d3e1465be,4724
# nightly-2024-01-06 provides tar-conduit-0.4.0
- tar-conduit-0.4.1@sha256:112d28118eb71901ea9e224e1b174c648b378256729669c2739b8b803d25b43a,3126

flags:
hackage-security:
Expand Down
17 changes: 5 additions & 12 deletions stack.yaml.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.