def init_app():
""" create a new app, or sync with an existing one """
cwd = os.path.abspath('.')
try:
repo = git.Repo.discover(cwd)
except NotGitRepository:
click.echo("No repository found")
sys.exit(1)
suggested_name = init.get_default_name(cwd)
if suggested_name is None:
click.echo("Unable to derive a name from the current git repository or directory!")
sys.exit(2)
name = click.prompt("Enter environment name".format(suggested_name), default=suggested_name)
init.initialize(name, repo.head())
评论列表
文章目录