bubble/dev.py

28 lines
681 B
Python
Executable File

#!/usr/bin/python3
from subprocess import run
from argparse import ArgumentParser
import os
if __name__ == '__main__':
parser = ArgumentParser()
parser.add_argument(
'-i',
'--init-db',
help='Run the admin cli to setup the db backend',
action='store_true'
)
parser.add_argument(
'-d',
'--db-url',
help='Sets the database URL to use for connecting to postgres',
default='postgres://psql:example@localhost:5432'
)
args = parser.parse_args()
env = os.environ
if args.init_db:
run('cargo run --bin admin-cli -- --setup'.split(), env=env)
else:
print('Nothing to do')