Skip to content

Commit

Permalink
[update]
Browse files Browse the repository at this point in the history
  • Loading branch information
boke0 committed Mar 5, 2021
1 parent 21dcc22 commit 6e0a4d4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions mitama/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@
init.set_defaults(handler=commands.init)

new = subparser.add_parser("new", help="Create new Mitama project directory")
new.add_argument("name", help="new project's name")
new.set_defaults(handler=commands.new)

mkapp = subparser.add_parser("mkapp", help="Create new Mitam application")
mkapp.add_argument("name", help="new app's name")
mkapp.set_defaults(handler=commands.mkapp)

version = subparser.add_parser("version", help="Check version code")
Expand Down
6 changes: 3 additions & 3 deletions mitama/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,17 @@ def init(args):

def mkapp(args):
try:
project_name = argv[0]
project_name = args.name
except IndexError:
raise IndexError("No app name given to command arguments.")
current_dir = Path(os.getcwd())
project_dir = current_dir / project_name
src = Path(os.path.dirname(__file__)) / "../skeleton/app_templates"
src = Path(os.path.dirname(__file__)) / "skeleton/app_templates"
shutil.copytree(src, project_dir, symlinks=False)

def new(args):
try:
project_name = argv[0]
project_name = args.name
except IndexError:
raise IndexError("No project name given to command arguments.")
current_dir = Path(os.getcwd())
Expand Down

0 comments on commit 6e0a4d4

Please sign in to comment.