Allow skipping the database need.
This commit is contained in:
parent
93678709c7
commit
c692e0acd2
@ -147,10 +147,14 @@ class PostgresCommands(Recipe):
|
||||
|
||||
self.database = check_type(args.get("database"), str)
|
||||
self.commands = check_type(args.get("commands"), list)
|
||||
self.skip_database_need = check_type(
|
||||
args.get("skip_database_need", False), bool
|
||||
)
|
||||
|
||||
def prepare(self, preparation: Preparation, head: Head) -> None:
|
||||
super().prepare(preparation, head)
|
||||
preparation.needs("postgres-database", self.database)
|
||||
if not self.skip_database_need:
|
||||
preparation.needs("postgres-database", self.database)
|
||||
|
||||
async def cook(self, kitchen: Kitchen) -> None:
|
||||
ch = await kitchen.start(PostgresTransaction(self.database))
|
||||
|
Loading…
Reference in New Issue
Block a user