@@ -14,9 +14,11 @@ import Data.Monoid
1414import qualified Data.Text as T
1515import qualified Data.Text.IO as T
1616import System.Directory
17+import System.Exit
1718import System.FilePath
1819import System.IO
1920import System.Posix (FileStatus, getFileStatus , deviceID, fileID, getRealUserID , fileOwner, fileMode)
21+import System.Process
2022
2123import Obelisk.Command.Thunk
2224
@@ -39,6 +41,15 @@ initProject target = do
3941 createDirectory obDir
4042 createThunkWithLatest implDir obeliskSource
4143 _ <- nixBuildThunkAttrWithCache implDir "command"
44+ skeleton <- nixBuildThunkAttrWithCache implDir "skeleton" --TODO: I don't think there's actually any reason to cache this
45+ (_, _, _, p) <- runInteractiveProcess "cp" --TODO: Make this package depend on nix-prefetch-url properly
46+ [ "-r"
47+ , "--no-preserve=mode"
48+ , "-T"
49+ , skeleton </> "."
50+ , target
51+ ] Nothing Nothing
52+ ExitSuccess <- waitForProcess p
4253 return ()
4354
4455--TODO: Handle errors