summaryrefslogtreecommitdiff
path: root/src/Command
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2025-11-05 21:14:01 +0100
committerRoman Smrž <roman.smrz@seznam.cz>2025-11-05 21:14:01 +0100
commitebe120fcfffc6d4d8ca261cfef7699eac7fd94fe (patch)
tree0e907f05a3c434abe8c2a13d94f8980e01f7785d /src/Command
parent164c2dc41dcdbda4df2f71cdced84f7831a049d0 (diff)
Store artifact work path along with data
Diffstat (limited to 'src/Command')
-rw-r--r--src/Command/Extract.hs10
1 files changed, 3 insertions, 7 deletions
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