-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test cases Fix dependencies Add test cases Add rm test cases Fix CI Fix CI Fix CI
- Loading branch information
1 parent
cc5348c
commit 5f280aa
Showing
5 changed files
with
197 additions
and
0 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,7 @@ | |
|
||
module Streamly.Coreutils.Chmod | ||
( chmod | ||
, perm | ||
) | ||
where | ||
|
||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
module Common | ||
( createParent | ||
, createDirWithParent | ||
, createDir | ||
, createFileWithParent | ||
, createFile | ||
) | ||
where | ||
|
||
import Control.Monad (unless) | ||
import System.Directory (createDirectory, createDirectoryIfMissing) | ||
import System.FilePath ((</>), takeDirectory) | ||
import System.IO ( IOMode (WriteMode), openFile, hClose) | ||
|
||
createParent :: FilePath -> FilePath -> IO () | ||
createParent file parent = do | ||
createDirectoryIfMissing True (parent </> takeDirectory file) | ||
|
||
createDirWithParent :: FilePath -> FilePath -> IO () | ||
createDirWithParent dir parent = | ||
unless (null dir) $ createDirectoryIfMissing True (parent </> dir) | ||
|
||
createDir :: FilePath -> FilePath -> IO () | ||
createDir dir parent = | ||
unless (null dir) $ createDirectory (parent </> dir) | ||
|
||
createFileWithParent :: FilePath -> FilePath -> IO () | ||
createFileWithParent file parent = do | ||
unless (null file) $ | ||
createDirectoryIfMissing True (parent </> takeDirectory file) | ||
openFile (parent </> file) WriteMode >>= hClose | ||
|
||
createFile :: FilePath -> FilePath -> IO () | ||
createFile file parent = | ||
openFile (parent </> file) WriteMode >>= hClose |
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