Give option to specify working directory (totally useless but too late now)
This commit is contained in:
parent
c43fee7024
commit
782729ee58
13
main.py
13
main.py
@ -4,6 +4,7 @@ from domain.Migrator import Migrator
|
||||
|
||||
|
||||
import argparse
|
||||
import os
|
||||
|
||||
|
||||
def main():
|
||||
@ -12,6 +13,14 @@ def main():
|
||||
prog="Mike's Gitea Repo Migrator - Move repositories from one Gitea instance to another"
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
"--cwd", "--working-directory",
|
||||
dest="working_directory",
|
||||
required=False,
|
||||
default=None,
|
||||
help="Specify the working directory"
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
"--source-hostname", "--source-host",
|
||||
dest="source_hostname",
|
||||
@ -132,6 +141,10 @@ def main():
|
||||
)
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
if args.working_directory is not None:
|
||||
os.chdir(args.working_directory)
|
||||
|
||||
mig = Migrator(
|
||||
source_host=args.source_hostname,
|
||||
source_port=args.source_port,
|
||||
|
Loading…
Reference in New Issue
Block a user