Fixed compile error from previous commit.

This commit is contained in:
Martin Sosic 2020-09-15 17:39:56 +02:00
parent 32bb439c53
commit 1f02809b3d

View File

@ -7,21 +7,22 @@ import Control.Monad.IO.Class (liftIO)
import StrongPath ((</>)) import StrongPath ((</>))
import Command (Command, CommandError(..)) import Command (Command, CommandError(..))
import Command.Common (findWaspProjectRootFromCwd, waspSays) import Command.Common (findWaspProjectRootDirFromCwd, waspSaysC)
import qualified Common import qualified Common
import qualified Generator.DbGenerator.Operations as DbOps import qualified Generator.DbGenerator.Operations as DbOps
migrate :: String -> Command () migrate :: String -> Command ()
migrate migrationName = do migrate migrationName = do
waspRootDir <- findWaspProjectRootFromCwd waspRootDir <- findWaspProjectRootDirFromCwd
let genProjectRootDir = waspRootDir </> Common.dotWaspDirInWaspProjectDir </> let genProjectRootDir = waspRootDir </> Common.dotWaspDirInWaspProjectDir </>
Common.generatedCodeDirInDotWaspDir Common.generatedCodeDirInDotWaspDir
waspSays "Saving db migration..." waspSaysC "Saving db migration..."
migrateSaveResult <- liftIO $ DbOps.migrateSave genProjectRootDir migrationName migrateSaveResult <- liftIO $ DbOps.migrateSave genProjectRootDir migrationName
case migrateSaveResult of case migrateSaveResult of
Left migrateSaveError -> throwError $ CommandError $ "Migrate save failed: " ++ migrateSaveError Left migrateSaveError -> throwError $ CommandError $ "Migrate save failed: " ++ migrateSaveError
Right () -> waspSays "Migration has been successfully saved." Right () -> waspSaysC "Migration has been successfully saved."
waspSays "All done!" waspSaysC "All done!"