Skip to content

Commit e1e636f

Browse files
committed
chore: move nub into dockerCpTar
So we can never forget it.
1 parent cdb771d commit e1e636f

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/Restyler/Config/CopyFiles.hs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ module Restyler.Config.CopyFiles
1616
import Restyler.Prelude
1717

1818
import Autodocodec hiding ((.=))
19-
import Data.List (nub)
2019
import OptEnvConf hiding (env)
2120
import Restyler.CodeVolume
2221
import Restyler.Config.Glob
@@ -117,9 +116,4 @@ copyCodeFiles remoteFiles paths vol = do
117116

118117
dockerCpAll ps =
119118
-- tar -cf - ps | docker cp - container:/path
120-
--
121-
-- Ensure ps doesn't contain duplicates, otherwise you'll get an obscure
122-
-- error from docker-cp, that it can't find /data.
123-
--
124-
-- https://github.com/restyled-io/actions/issues/391
125-
dockerCpTar (nub ps) $ vol.container.unwrap <> ":" <> toFilePath vol.path.unwrap
119+
dockerCpTar ps $ vol.container.unwrap <> ":" <> toFilePath vol.path.unwrap

src/Restyler/Monad/Docker.hs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ module Restyler.Monad.Docker
1818

1919
import Restyler.Prelude
2020

21+
import Data.List (nub)
2122
import Data.Text qualified as T
2223
import Restyler.AnnotatedException
2324
import System.Process.Typed
@@ -62,8 +63,13 @@ instance
6263
dockerCp src dst = runDocker_ ["cp", "--quiet", src, dst]
6364
dockerCpTar ps dst = do
6465
let
66+
-- Ensure ps doesn't contain duplicates, otherwise you'll get an obscure
67+
-- error from docker-cp, that it can't find /data.
68+
--
69+
-- https://github.com/restyled-io/actions/issues/391
70+
--
6571
tArgs :: [String]
66-
tArgs = ["-cf", "-"] <> map toFilePath ps
72+
tArgs = ["-cf", "-"] <> map toFilePath (nub ps)
6773

6874
dArgs :: [String]
6975
dArgs = ["cp", "--quiet", "-", dst]

0 commit comments

Comments
 (0)