allow complex shell commands
authorJoey Hess <joeyh@joeyh.name>
Mon, 23 Sep 2024 19:04:33 +0000 (15:04 -0400)
committerJoey Hess <joeyh@joeyh.name>
Mon, 23 Sep 2024 19:04:33 +0000 (15:04 -0400)
Annex/Sim.hs

index 7e2f6a8071e66e7ad0ff7498e4eabe5034d211ae..b57148ccac2c7d7999d00cc9b7b9288676d78e3d 100644 (file)
@@ -287,11 +287,11 @@ applySimCommand c@(CommandVisit repo cmdparams) st _ =
                unlessM (liftIO $ doesDirectoryExist dir) $
                        giveup "Simulated repository unavailable."
                (cmd, params) <- case cmdparams of
-                       (cmd:params) -> return (cmd, params)
                        [] -> do
                                showLongNote "Starting a shell in the simulated repository."
                                shellcmd <- liftIO $ fromMaybe "sh" <$> getEnv "SHELL"
                                return (shellcmd, [])
+                       _ -> return ("sh", ["-c", unwords cmdparams])
                exitcode <- liftIO $
                        safeSystem' cmd (map Param params)
                                (\p -> p { cwd = Just dir })