Skip to content

Commit 327cb57

Browse files
committed
mismi-cli: Add --recursive option to upload
1 parent 35797f8 commit 327cb57

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

mismi-cli/main/s3.hs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ data UnitPrefix =
6868
deriving (Eq, Show)
6969

7070
data Command =
71-
Upload FilePath Address WriteMode
71+
Upload Recursive FilePath Address WriteMode
7272
| Download Recursive Address FilePath
7373
| Copy Address Address WriteMode
7474
| Concat [Address] Address WriteMode Int
@@ -126,8 +126,10 @@ run c = do
126126
let
127127
e' = configure (over serviceRetry (set retryAttempts 10 . set exponentBase 0.6) s3) e
128128
orDie O.renderError . O.runAWS e' $ case c of
129-
Upload s d m ->
129+
Upload NotRecursive s d m ->
130130
uploadWithModeOrFail m s d
131+
Upload Recursive s d m ->
132+
uploadRecursiveWithModeOrFail m s d
131133
Download NotRecursive s d ->
132134
renderExit renderDownloadError . download s . optAppendFileName d $ key s
133135
Download Recursive s d ->
@@ -299,7 +301,7 @@ commandP' :: Force -> Parser Command
299301
commandP' f = XOA.subparser $
300302
command' "upload"
301303
"Upload a file to s3."
302-
(Upload <$> filepath' <*> address' <*> writeMode' f)
304+
(Upload <$> recursive' <*> filepath' <*> address' <*> writeMode' f)
303305
<> command' "download"
304306
"Download a file from s3."
305307
(Download <$> recursive' <*> address' <*> filepath')

0 commit comments

Comments
 (0)