on master help sign in
ob deploy update: Update src thunk to latest
commit884f2247535ef63a8c52f22e97dce50826d8b08f authorLuigy Leon <luigy@outlook.com> dateFri 11 May 2018, 15:26 (8 years ago) parent1bfce65
2 files changed+7
lib/command/src/Obelisk/Command.hs+3 lib/command/src/Obelisk/Command/Deploy.hs+4
lib/command/src/Obelisk/Command.hs+3
@@ -98,6 +98,7 @@ deployCommand :: Parser DeployCommand
9898deployCommand = hsubparser $ mconcat
9999 [ command "init" $ info deployInitCommand $ progDesc "Initialize a deployment configuration directory"
100100 , command "push" $ info (pure DeployCommand_Push) mempty
101+ , command "update" $ info (pure DeployCommand_Update) $ progDesc "Update the deployment's src thunk to latest"
101102 ]
102103
103104deployInitCommand :: Parser DeployCommand
@@ -110,6 +111,7 @@ deployInitCommand = fmap DeployCommand_Init $ DeployInitOpts
110111data DeployCommand
111112 = DeployCommand_Init DeployInitOpts
112113 | DeployCommand_Push
114+ | DeployCommand_Update
113115
114116data DeployInitOpts = DeployInitOpts
115117 { _deployInitOpts_ouputDir :: FilePath
@@ -204,6 +206,7 @@ ob = \case
204206 hostname = _deployInitOpts_hostname deployOpts
205207 deployInit thunkPtr (root </> "config") deployDir sshKeyPath hostname
206208 DeployCommand_Push -> deployPush "."
209+ DeployCommand_Update -> deployUpdate "."
207210 ObCommand_Run -> inNixShell' $ static run
208211 -- inNixShell ($(mkClosure 'ghcidAction) ())
209212 ObCommand_Thunk tc -> case tc of
lib/command/src/Obelisk/Command/Deploy.hs+4
@@ -81,3 +81,7 @@ deployPush deployPath = do
8181 when (not isClean) $ do
8282 callProcess "git" ["-C", deployPath, "add", "--update"]
8383 callProcess "git" ["-C", deployPath, "commit", "-m", "New deployment"]
84+
85+deployUpdate :: FilePath -> IO ()
86+deployUpdate deployPath = updateThunkToLatest $ deployPath </> "src"
87+