add home folder

This commit is contained in:
Ville Rantanen
2021-05-16 13:52:15 +03:00
parent 73f5c34482
commit 431d05980f

13
flit.py
View File

@@ -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()
if opts.home == None:
os.chdir(os.path.dirname(__file__))
else:
os.chdir(opts.home)
if opts.command == "add":
""" Add a new share """