diff --git a/stack-8.2.2.yaml b/stack-8.2.2.yaml index 982973d5..0af83934 100644 --- a/stack-8.2.2.yaml +++ b/stack-8.2.2.yaml @@ -9,6 +9,7 @@ extra-deps: - brick-0.41.4 - config-ini-0.2.4.0 - relude-0.4.0 + - shellmet-0.0.0 - tomland-1.0.0 - megaparsec-7.0.4 # needed for tomland-0.5.0 - parser-combinators-1.0.0 # needed for megaparsec >= 7 diff --git a/stack-8.4.4.yaml b/stack-8.4.4.yaml index 64621ba7..841ca4c6 100644 --- a/stack-8.4.4.yaml +++ b/stack-8.4.4.yaml @@ -9,6 +9,7 @@ extra-deps: - brick-0.41.4 - config-ini-0.2.4.0 - relude-0.4.0 + - shellmet-0.0.0 - tomland-1.0.0 - megaparsec-7.0.4 # needed for tomland-0.5.0 - neat-interpolation-0.3.2.4 # needed because of megaparsec >= 7 diff --git a/stack.yaml b/stack.yaml index 7304d83d..cf0c45e8 100644 --- a/stack.yaml +++ b/stack.yaml @@ -5,6 +5,7 @@ packages: - summoner-tui/ extra-deps: + - shellmet-0.0.0 - tomland-1.0.0 - brick-0.41.4 - config-ini-0.2.4.0 # needed for brick diff --git a/summoner-cli/src/Summoner/Process.hs b/summoner-cli/src/Summoner/Process.hs index ea2d221e..9be83972 100644 --- a/summoner-cli/src/Summoner/Process.hs +++ b/summoner-cli/src/Summoner/Process.hs @@ -10,18 +10,10 @@ module Summoner.Process import Control.Exception (catch) import System.Directory (removeFile) -import System.Process (callCommand, showCommandForUser) import Summoner.Ansi (errorMessage) --- | This is needed to be able to call commands by writing strings. -instance (a ~ Text, b ~ ()) => IsString ([a] -> IO b) where - fromString cmd args = do - let cmdStr = showCommandForUser cmd (map toString args) - putStrLn $ "⚙ " ++ cmdStr - callCommand cmdStr - -- | Delete file, but just print a message if delete fails and continue instead of raising an error. deleteFile :: FilePath -> IO () deleteFile file = removeFile file `catch` printError diff --git a/summoner-cli/src/Summoner/Project.hs b/summoner-cli/src/Summoner/Project.hs index f08ac1db..921f5704 100644 --- a/summoner-cli/src/Summoner/Project.hs +++ b/summoner-cli/src/Summoner/Project.hs @@ -9,6 +9,7 @@ module Summoner.Project import Data.List (intersect) import NeatInterpolation (text) +import Shellmet () import System.Directory (setCurrentDirectory) import Summoner.Ansi (Color (Green), beautyPrint, bold, errorMessage, infoMessage, setColor, diff --git a/summoner-cli/summoner.cabal b/summoner-cli/summoner.cabal index 577869d7..763f0871 100644 --- a/summoner-cli/summoner.cabal +++ b/summoner-cli/summoner.cabal @@ -65,6 +65,7 @@ library , optparse-applicative ^>= 0.14.2.0 , process ^>= 1.6.1.0 , relude ^>= 0.4.0 + , shellmet >= 0.0.0 , text ^>= 1.2.3.0 , time ^>= 1.8 , tomland ^>= 1.0