Skip to content

Commit

Permalink
[#288] Use shellmet library
Browse files Browse the repository at this point in the history
Resolves #288
  • Loading branch information
vrom911 committed Feb 24, 2019
1 parent 2993f30 commit a54e93f
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 8 deletions.
1 change: 1 addition & 0 deletions stack-8.2.2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions stack-8.4.4.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 0 additions & 8 deletions summoner-cli/src/Summoner/Process.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions summoner-cli/src/Summoner/Project.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions summoner-cli/summoner.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a54e93f

Please sign in to comment.