diff options
author | Tobias Bora <tobias.bora@gmail.com> | 2020-11-11 22:19:08 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-12 00:19:08 +0300 |
commit | 6ea0b9bf7c1920278809bc7e507a46ee224944dc (patch) | |
tree | 15f8b5f0e9561c3ee8e8f6396a13e697c9b743be | |
parent | 17b4c81c1457e00c17e0ca6c8b2dc9d6d596f349 (diff) | |
download | hakyll-6ea0b9bf7c1920278809bc7e507a46ee224944dc.tar.gz |
Make sure the initial project is writable (#804)
-rw-r--r-- | src/Init.hs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Init.hs b/src/Init.hs index 09f8ed7..63899e4 100644 --- a/src/Init.hs +++ b/src/Init.hs @@ -11,7 +11,8 @@ import Data.Char (isAlphaNum, isNumber) import Data.List (foldl', intercalate, isPrefixOf) import Data.Version (Version (..)) import System.Directory (canonicalizePath, copyFile, - doesFileExist) + doesFileExist, + setPermissions, getPermissions, writable) import System.Environment (getArgs, getProgName) import System.Exit (exitFailure) import System.FilePath (splitDirectories, (</>)) @@ -65,6 +66,10 @@ main = do putStrLn $ "Creating " ++ dst makeDirectories dst copyFile src dst + -- On some systems, the source folder may be readonly, + -- and copyFile will therefore create a readonly project... + p <- getPermissions dst + setPermissions dst (p {writable = True}) putStrLn $ "Creating " ++ cabalPath createCabal cabalPath name |