@@ -86,8 +86,11 @@ initSource = foldl1 (<|>)
8686 , InitSource_Symlink <$> strOption (long "symlink" <> action "directory" <> metavar "PATH")
8787 ]
8888
89+initForce :: Parser Bool
90+initForce = switch (long "force" <> help "Allow ob init to overwrite files")
91+
8992data ObCommand
90− = ObCommand_Init InitSource
93+ = ObCommand_Init InitSource Bool
9194 | ObCommand_Deploy DeployCommand
9295 | ObCommand_Run
9396 | ObCommand_Thunk ThunkCommand
@@ -127,7 +130,7 @@ inNixShell' p = withProjectRoot "." $ \root -> do
127130obCommand :: ArgsConfig -> Parser ObCommand
128131obCommand cfg = hsubparser
129132 (mconcat
130− [ command "init" $ info (ObCommand_Init <$> initSource) $ progDesc "Initialize an Obelisk project"
133+ [ command "init" $ info (ObCommand_Init <$> initSource <*> initForce) $ progDesc "Initialize an Obelisk project"
131134 , command "deploy" $ info (ObCommand_Deploy <$> deployCommand cfg) $ progDesc "Prepare a deployment for an Obelisk project"
132135 , command "run" $ info (pure ObCommand_Run) $ progDesc "Run current project in development mode"
133136 , command "thunk" $ info (ObCommand_Thunk <$> thunkCommand) $ progDesc "Manipulate thunk directories"
@@ -369,7 +372,7 @@ parseHandoff as' = case hasNoHandoff as' of
369372
370373ob :: MonadObelisk m => ObCommand -> m ()
371374ob = \case
372− ObCommand_Init source -> initProject source
375+ ObCommand_Init source force -> initProject source force
373376 ObCommand_Deploy dc -> case dc of
374377 DeployCommand_Init deployOpts -> withProjectRoot "." $ \root -> do
375378 let deployDir = _deployInitOpts_outputDir deployOpts