Safe Haskell | Safe-Inferred |
---|
Various functions used inside Gitson.
Documentation
entryPath :: FilePath -> FilePath -> FilePathSource
Combines two paths and adds the .json extension.
>>>
entryPath "things" "entry"
"things/entry.json"
>>>
entryPath "things/" "entry"
"things/entry.json"
filterFilenamesAsKeys :: [String] -> [String]Source
Turns a list of filenames into a list of keys, ignoring non-JSON files.
>>>
filterFilenamesAsKeys [".", "..", "k1.json", "unrelated.file"]
["k1"]
filterDirs :: [FilePath] -> IO [FilePath]Source
Filters a list of file paths, leaving only paths to existing non-hidden directories.
insideDirectory :: FilePath -> IO a -> IO aSource
Returns an IO action that switches the current directory to a given path, executes the given IO action and switches the current directory back.
lastCommitText :: IO StringSource
Returns the message of the last git commit in the repo where the current directory is located.