on master help sign in
Create .attr-cache on thunk creation; account for it in readThunk
a67be1eMadeline Haraj
command/src/Obelisk/Command/Thunk.hs+2−2
@@ -122,7 +122,7 @@ readThunk thunkDir = do
122
122
123 -- Ensure that there aren't any other files in the thunk
123 -- Ensure that there aren't any other files in the thunk
124 files <- listDirectory thunkDir
124 files <- listDirectory thunkDir
125− guard $ length files == 2
125+ guard $ length files == 3
126
126
127 txt <- LBS.readFile githubJson
127 txt <- LBS.readFile githubJson
128 let p v = do
128 let p v = do
@@ -157,7 +157,7 @@ overwriteThunk target thunk = do
157
157
158createThunk :: FilePath -> ThunkPtr -> IO ()
158createThunk :: FilePath -> ThunkPtr -> IO ()
159createThunk target thunk = do
159createThunk target thunk = do
160− createDirectory target
160+ createDirectoryIfMissing True (target </> ".attr-cache")
161 case _thunkPtr_source thunk of
161 case _thunkPtr_source thunk of
162 ThunkSource_GitHub s -> do
162 ThunkSource_GitHub s -> do
163 T.writeFile (target </> "default.nix") $ NonEmpty.head gitHubStandaloneLoaders
163 T.writeFile (target </> "default.nix") $ NonEmpty.head gitHubStandaloneLoaders