Skip to content

Commit

Permalink
Revert "Use absolute path"
Browse files Browse the repository at this point in the history
It's not necessary but breaking rename

This reverts commit 6451b02.
  • Loading branch information
fujimura committed Mar 24, 2024
1 parent d55ff1f commit b14ec4e
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/Lib.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
Expand Down

0 comments on commit b14ec4e

Please sign in to comment.