From b14ec4ea01ea03b970eded2ae4e71a720a8fdb57 Mon Sep 17 00:00:00 2001 From: Daisuke Fujimura Date: Sun, 24 Mar 2024 22:32:47 +0900 Subject: [PATCH] Revert "Use absolute path" It's not necessary but breaking rename This reverts commit 6451b0297754fa6dd37c1caed1ace8c57a9d3339. --- src/Lib.hs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/Lib.hs b/src/Lib.hs index 693d3e2..52e6aee 100644 --- a/src/Lib.hs +++ b/src/Lib.hs @@ -11,7 +11,7 @@ import qualified Data.Text.Lazy as T import qualified Data.Text.Lazy.Encoding as T import qualified Data.Text.Lazy.IO as T import System.Directory (createDirectoryIfMissing, doesFileExist, renameFile) -import System.FilePath (() , dropFileName) +import System.FilePath (dropFileName) import System.IO ( BufferMode (NoBuffering), hClose, @@ -37,11 +37,7 @@ run Options {from, to, path, rename} = do getTargetFiles :: FilePath -> IO [FilePath] getTargetFiles path = do (_, result, _) <- readProcessWithExitCode "git" ["ls-files", path] [] - (_, pwd, _) <- readProcessWithExitCode "git" ["rev-parse", "--show-toplevel"] [] - return $ map (trim pwd ) $ lines result - where - trim :: String -> String - trim = unwords . words + return (lines result) processFile :: RE -> -- From