add home folder
This commit is contained in:
15
flit.py
15
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 """
|
||||
|
||||
|
||||
Reference in New Issue
Block a user