@@ -328,10 +328,10 @@ createThunkWithLatest target s = do
328updateThunkToLatest :: MonadObelisk m => FilePath -> m ()
328updateThunkToLatest :: MonadObelisk m => FilePath -> m ()
329updateThunkToLatest target = do
329updateThunkToLatest target = do
330 (overwrite, ptr) <- readThunk target >>= \case
330 (overwrite, ptr) <- readThunk target >>= \case
331− Left err -> liftIO $ failWith $ T.pack $ "thunk update: " <> show err
331+ Left err -> failWith $ T.pack $ "thunk update: " <> show err
332 Right c -> case c of
332 Right c -> case c of
333 ThunkData_Packed t -> return (target, t)
333 ThunkData_Packed t -> return (target, t)
334− ThunkData_Checkout _ -> liftIO $ failWith "cannot update an unpacked thunk"
334+ ThunkData_Checkout _ -> failWith "cannot update an unpacked thunk"
335 let src = _thunkPtr_source ptr
335 let src = _thunkPtr_source ptr
336 rev <- liftIO $ getLatestRev src
336 rev <- liftIO $ getLatestRev src
337 overwriteThunk overwrite $ ThunkPtr
337 overwriteThunk overwrite $ ThunkPtr
@@ -410,7 +410,7 @@ nixBuildThunkAttrWithCache thunkDir attr = do
410 --This should be guaranteed by the command argument parser.
410 --This should be guaranteed by the command argument parser.
411 let cacheErrHandler e
411 let cacheErrHandler e
412 | isDoesNotExistError e = return Nothing -- expected from a cache miss
412 | isDoesNotExistError e = return Nothing -- expected from a cache miss
413− | otherwise = liftIO $ putError (T.pack $ displayException e) >> return Nothing
413+ | otherwise = putError (T.pack $ displayException e) >> return Nothing
414 cacheDir = thunkDir </> ".attr-cache"
414 cacheDir = thunkDir </> ".attr-cache"
415 cachePath = cacheDir </> attr <.> "out"
415 cachePath = cacheDir </> attr <.> "out"
416 liftIO $ createDirectoryIfMissing False cacheDir
416 liftIO $ createDirectoryIfMissing False cacheDir
@@ -423,7 +423,7 @@ nixBuildThunkAttrWithCache thunkDir attr = do
423 case cacheHit of
423 case cacheHit of
424 Just c -> return c
424 Just c -> return c
425 Nothing -> do
425 Nothing -> do
426− liftIO $ putWarning $ T.pack $ mconcat [thunkDir, ": ", attr, " not cached, building ..."]
426+ putWarning $ T.pack $ mconcat [thunkDir, ": ", attr, " not cached, building ..."]
427 _ <- nixBuild $ def
427 _ <- nixBuild $ def
428 { _nixBuildConfig_target = Target
428 { _nixBuildConfig_target = Target
429 { _target_path = thunkDir
429 { _target_path = thunkDir
@@ -459,15 +459,15 @@ unpackThunk
459 => FilePath
459 => FilePath
461unpackThunk thunkDir = readThunk thunkDir >>= \case
461unpackThunk thunkDir = readThunk thunkDir >>= \case
462− Left err -> liftIO $ failWith $ "thunk unpack: " <> (T.pack $ show err)
462+ Left err -> failWith $ "thunk unpack: " <> (T.pack $ show err)
463 --TODO: Overwrite option that rechecks out thunk; force option to do so even if working directory is dirty
463 --TODO: Overwrite option that rechecks out thunk; force option to do so even if working directory is dirty
464− Right (ThunkData_Checkout _) -> liftIO $ failWith "thunk unpack: thunk is already unpacked"
464+ Right (ThunkData_Checkout _) -> failWith "thunk unpack: thunk is already unpacked"
465 Right (ThunkData_Packed tptr) -> case _thunkPtr_source tptr of
465 Right (ThunkData_Packed tptr) -> case _thunkPtr_source tptr of
466 ThunkSource_GitHub s | (thunkParent, thunkName) <- splitFileName thunkDir -> withTempDirectory thunkParent thunkName $ \tmpRepo -> do
466 ThunkSource_GitHub s | (thunkParent, thunkName) <- splitFileName thunkDir -> withTempDirectory thunkParent thunkName $ \tmpRepo -> do
467 mauth <- liftIO $ getHubAuth "github.com"
467 mauth <- liftIO $ getHubAuth "github.com"
468 repoResult <- liftIO $ executeRequestMaybe mauth $ repositoryR (_gitHubSource_owner s) (_gitHubSource_repo s)
468 repoResult <- liftIO $ executeRequestMaybe mauth $ repositoryR (_gitHubSource_owner s) (_gitHubSource_repo s)
469 githubURI <- liftIO $ either throwIO (return . repoSshUrl) repoResult >>= \case
469 githubURI <- liftIO $ either throwIO (return . repoSshUrl) repoResult >>= \case
470− Nothing -> liftIO $ failWith "Cannot determine clone URI for thunk source"
470+ Nothing -> failWith "Cannot determine clone URI for thunk source"
471 Just c -> return $ T.unpack $ getUrl c
471 Just c -> return $ T.unpack $ getUrl c
472 withSpinner "Cloning from GitHub ..." (Just $ "Cloned " <> githubURI) $ do
472 withSpinner "Cloning from GitHub ..." (Just $ "Cloned " <> githubURI) $ do
473 liftIO $ callProcess "hub" --TODO: Depend on hub explicitly
473 liftIO $ callProcess "hub" --TODO: Depend on hub explicitly
@@ -514,8 +514,8 @@ packThunk
514 -> String
514 -> String
516packThunk thunkDir upstream = readThunk thunkDir >>= \case
516packThunk thunkDir upstream = readThunk thunkDir >>= \case
517− Left err -> liftIO $ failWith $ T.pack $ "thunk pack: " <> show err
517+ Left err -> failWith $ T.pack $ "thunk pack: " <> show err
518− Right (ThunkData_Packed _) -> liftIO $ failWith "pack: thunk is already packed"
518+ Right (ThunkData_Packed _) -> failWith "pack: thunk is already packed"
519 Right (ThunkData_Checkout _) -> do
519 Right (ThunkData_Checkout _) -> do
520 thunkPtr <- liftIO $ getThunkPtr thunkDir upstream
520 thunkPtr <- liftIO $ getThunkPtr thunkDir upstream
521 liftIO $ callProcess "rm"
521 liftIO $ callProcess "rm"