From 00cade9f5bd860fdc4e3cd3290c64ed3d88c168d Mon Sep 17 00:00:00 2001 From: Santo Cariotti Date: Thu, 9 Apr 2020 21:34:08 +0200 Subject: feat: init project command --- bin/frest | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/frest b/bin/frest index f41df68..c274ca5 100755 --- a/bin/frest +++ b/bin/frest @@ -1,14 +1,16 @@ #!/usr/bin/env python import argparse -from frest.manage.utils import logo, create_app +from frest.manage.utils import logo, create_app, init_project from frest.manage.utils import logging, logging_arg import os +import sys def main(): parser = argparse.ArgumentParser() parser.add_argument("--startapp", "-s", type=str, help="create new app") + parser.add_argument("--init", "-", type=str, help="create new project") args = parser.parse_args() if args.startapp: @@ -18,6 +20,13 @@ def main(): os.mkdir("scheme") create_app(args.startapp) + elif args.init: + appname = args.init + if os.path.exists(appname): + logging("App already exists", 2, "\n") + sys.exit(1) + + init_project(appname) if __name__ == "__main__": -- cgit v1.2.3-18-g5258