Created
February 17, 2021 01:39
-
-
Save Javran/217264db9fbe2b10cc75914f37865fa5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE LambdaCase #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
{-# OPTIONS_GHC -fno-warn-unused-imports -fno-warn-unused-top-binds #-} | |
module Lib | |
( main | |
) | |
where | |
import Control.Applicative | |
import qualified Control.Foldl as Fold | |
import Control.Monad | |
import qualified Data.Set as S | |
import qualified Data.Text as T | |
import qualified Data.Text.IO as T | |
import Filesystem.Path.CurrentOS | |
import System.Environment | |
import System.Exit hiding (die) | |
import Turtle.Pattern | |
import Turtle.Prelude | |
import Turtle.Shell | |
import Prelude hiding (FilePath) | |
fpToText :: FilePath -> T.Text | |
fpToText = either id id . Filesystem.Path.CurrentOS.toText | |
performSomething :: FilePath -> Shell () | |
performSomething fp = do | |
echo "<some actions..>" | |
fns <- reduce Fold.list (find (suffix ".hs") (fp </> "src/")) | |
_ec <- proc "ormolu" ("--mode=inplace" : fmap fpToText fns) "" | |
echo "<some other actions...>" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment