on master help sign in
Use createDirectoryIfMissing instead of mkdir subprocess
d89b1a6Leon P Smith
lib/command/src/Obelisk/Command/Deploy.hs+6−8
@@ -85,14 +85,12 @@ deployInit' thunkPtr (DeployInitOpts deployDir sshKeyPath hostnames route adminE
85 --accidentally create a production deployment that uses development
85 --accidentally create a production deployment that uses development
86 --credentials to connect to some resources. This could result in, e.g.,
86 --credentials to connect to some resources. This could result in, e.g.,
87 --production data backed up to a dev environment.
87 --production data backed up to a dev environment.
88− withSpinner "Creating project configuration directories" $ do
88+ withSpinner "Creating project configuration directories" $ liftIO $ do
89− callProcessAndLogOutput (Notice, Error) $
89+ mapM_ (createDirectoryIfMissing True)
90− proc mkdirPath
91− [ "-p"
92− , deployDir </> "config" </> "backend"
90+ [ deployDir </> "config" </> "backend"
93− , deployDir </> "config" </> "common"
91+ , deployDir </> "config" </> "common"
94− , deployDir </> "config" </> "frontend"
92+ , deployDir </> "config" </> "frontend"
95− ]
93+ ]
96
94
97 let srcDir = deployDir </> "src"
95 let srcDir = deployDir </> "src"
98 withSpinner ("Creating source thunk (" <> T.pack (makeRelative deployDir srcDir) <> ")") $ do
96 withSpinner ("Creating source thunk (" <> T.pack (makeRelative deployDir srcDir) <> ")") $ do
lib/command/src/Obelisk/Command/Utils.hs−3
@@ -39,9 +39,6 @@ mvPath = $(staticWhich "mv")
39rmPath :: FilePath
39rmPath :: FilePath
40rmPath = $(staticWhich "rm")
40rmPath = $(staticWhich "rm")
41
41
42−mkdirPath :: FilePath
43−mkdirPath = $(staticWhich "mkdir")
44−
45ghcidExePath :: FilePath
42ghcidExePath :: FilePath
46ghcidExePath = $(staticWhich "ghcid")
43ghcidExePath = $(staticWhich "ghcid")
47
44