From ebe120fcfffc6d4d8ca261cfef7699eac7fd94fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Wed, 5 Nov 2025 21:14:01 +0100 Subject: Store artifact work path along with data --- src/Command/Extract.hs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src/Command') diff --git a/src/Command/Extract.hs b/src/Command/Extract.hs index b21c63c..6828029 100644 --- a/src/Command/Extract.hs +++ b/src/Command/Extract.hs @@ -93,15 +93,11 @@ cmdExtract (ExtractCommand ExtractOptions {..} ExtractArguments {..}) = do True -> return () False -> tfail $ "artifact ‘" <> aname <> "’ of job ‘" <> textJobId jid <> "’ not found" - afile <- liftIO (listDirectory adir) >>= \case - [ file ] -> return file - [] -> tfail $ "artifact ‘" <> aname <> "’ of job ‘" <> textJobId jid <> "’ not found" - _:_:_ -> tfail $ "unexpected files in ‘" <> T.pack adir <> "’" - - let tpath | isdir = extractDestination afile + wpath <- liftIO $ readFile (adir "path") + let tpath | isdir = extractDestination takeFileName wpath | otherwise = extractDestination when (not extractForce) $ do liftIO (doesPathExist tpath) >>= \case True -> tfail $ "destination ‘" <> T.pack tpath <> "’ already exists" False -> return () - liftIO $ copyRecursiveForce (adir afile) tpath + liftIO $ copyRecursiveForce (adir "data") tpath -- cgit v1.2.3