diff --git a/main.py b/main.py index 9eac14f..913990c 100644 --- a/main.py +++ b/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,