packages feed

postgresql-schema 0.1.9 → 0.1.10

raw patch · 2 files changed

+9/−5 lines, 2 files

Files

main/Clear.hs view
@@ -18,6 +18,7 @@  data Args = Args   { aUrl :: Maybe String+  , aYes :: Bool   } deriving ( Eq, Read, Show )  args :: ParserInfo Args@@ -31,6 +32,9 @@           (  long    "url"           <> metavar "URL"           <> help    "Database URL" ) )+      <*> switch+          (  long "yes"+          <> help  "Assume 'yes'" )  prompt :: String -> IO Bool prompt url = do@@ -38,9 +42,9 @@   hFlush stdout   (== "y") <$> getLine -exec :: String -> IO ()-exec url = do-  y <- prompt url+exec :: Bool -> String -> IO ()+exec yes url = do+  y <- if yes then return True else prompt url   when y $ shelly $     clear schema (pack url) where       schema = "schema_evolution_manager"@@ -50,5 +54,5 @@   execParser args >>= call where     call Args{..} = do       url <- lookupEnv "DATABASE_URL"-      maybe (err "No Database URL") exec (aUrl <|> url) where+      maybe (err "No Database URL") (exec aYes) (aUrl <|> url) where         err = hPutStrLn stderr
postgresql-schema.cabal view
@@ -1,5 +1,5 @@ name:                  postgresql-schema-version:               0.1.9+version:               0.1.10 synopsis:              PostgreSQL Schema Management description:           Please see README.md homepage:              https://github.com/mfine/postgresql-schema