diff --git a/lpp.py b/lpp.py index 0fd8b3f..15b9b96 100644 --- a/lpp.py +++ b/lpp.py @@ -6,9 +6,9 @@ import argparse parser = argparse.ArgumentParser(description="A python project preparator for Linux") -parser.add_argument('-n','--name',action='store_const',default='NewProject',const='NewProject',help='The project name') -parser.add_argument('-p','--path',action='store_const',default=False,const=False,help='The path to create the project in') -parser.add_argument('-f','--filename',action='store_const',default='main.py',const='main.py',help="Initial file name") +parser.add_argument('-n','--name',default='NewProject',help='The project name') +parser.add_argument('-p','--path',default=False,help='The path to create the project in') +parser.add_argument('-f','--filename',default='main.py',help="Initial file name") parser.add_argument('-g','--git',action='store_true',help='If "git init" should be used') args = parser.parse_args(sys.argv[1:]) @@ -16,8 +16,8 @@ args = parser.parse_args(sys.argv[1:]) if not args.path : path = Path().cwd() else : - dest = args.path if args.path[0]=='~' else Path.home() + args.path[1:] - path = Path(dest+f"/{args.name}") + dest = args.path if args.path[0]!='~' else Path.home().as_posix() + args.path[1:] + path = Path(dest) if not path.exists() and path.is_file() : raise Exception('Path does not exist')