From 431d05980f534e501c8277e41f2844562fffae75 Mon Sep 17 00:00:00 2001 From: Ville Rantanen Date: Sun, 16 May 2021 13:52:15 +0300 Subject: [PATCH] add home folder --- flit.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/flit.py b/flit.py index 5d43ced..e018858 100755 --- a/flit.py +++ b/flit.py @@ -72,6 +72,15 @@ def parse_opts(): default="", help="Root address for printing URLS", ) + parser.add_argument( + "--home", + action="store", + dest="home", + type=str, + default=None, + help="Home folder for flit. This is where folders are created, and --root should point to in the filesystem. Defaults to script location", + ) + subparsers = parser.add_subparsers(dest="command", help="Command defaults to add") add_parser = subparsers.add_parser("add", add_help=False) add_parser.add_argument( @@ -367,7 +376,11 @@ def write_config(p, config): if __name__ == "__main__": opts = parse_opts() cwd = os.getcwd() - os.chdir(os.path.dirname(__file__)) + if opts.home == None: + os.chdir(os.path.dirname(__file__)) + else: + os.chdir(opts.home) + if opts.command == "add": """ Add a new share """