File tree Expand file tree Collapse file tree 1 file changed +17
-8
lines changed Expand file tree Collapse file tree 1 file changed +17
-8
lines changed Original file line number Diff line number Diff line change @@ -68,14 +68,23 @@ run :: () -> Lamdera.CLI.Check.Flags -> IO ()
6868run () flags@ (Lamdera.CLI.Check. Flags destructiveMigration) = do
6969 debug_ " Starting check..."
7070
71- branch <- Lamdera. getGitBranch
72- case branch of
73- " main" -> runHelp () flags
74- " master" -> runHelp () flags
75- _ -> do
76- atomicPutStrLn " `lamdera check` is only for main/master branches when preparing for a production deploy."
77- atomicPutStrLn " If you're trying to deploy a preview app, use `lamdera deploy` instead."
78- pure ()
71+ inProduction_ <- Lamdera. inProduction
72+
73+ if inProduction_
74+ then
75+ -- In production check will only get run in the right context
76+ -- and we also may not have branch information available due to the checkout mechanism
77+ -- so assume the invocation is right and allow it to continue
78+ runHelp () flags
79+ else do
80+ branch <- Lamdera. getGitBranch
81+ case branch of
82+ " main" -> runHelp () flags
83+ " master" -> runHelp () flags
84+ _ -> do
85+ atomicPutStrLn " `lamdera check` is only for main/master branches when preparing for a production deploy."
86+ atomicPutStrLn " If you're trying to deploy a preview app, use `lamdera deploy` instead."
87+ pure ()
7988
8089
8190runHelp :: () -> Lamdera.CLI.Check. Flags -> IO ()
You can’t perform that action at this time.
0 commit comments