From 782729ee582aeffde8b5edef0c3016916c14a939 Mon Sep 17 00:00:00 2001 From: mike Date: Sat, 4 Jan 2025 02:13:40 -0800 Subject: [PATCH] Give option to specify working directory (totally useless but too late now) --- main.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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,