Commit 2702d5c 1 parent c127001 commit 2702d5c Copy full SHA for 2702d5c
File tree 2 files changed +23
-2
lines changed
2 files changed +23
-2
lines changed Original file line number Diff line number Diff line change 9
9
import re
10
10
import subprocess
11
11
import typing as t
12
+ from argparse import ArgumentParser , Namespace
12
13
from dataclasses import dataclass
13
14
from pathlib import Path
14
15
from subprocess import CalledProcessError
@@ -27,6 +28,23 @@ class Submodule:
27
28
url : str
28
29
29
30
31
+ def get_namespace () -> Namespace :
32
+ """Get the command line values passed to this script.
33
+
34
+ Returns:
35
+ An object containing all the command line values.
36
+ """
37
+ arg_parser = ArgumentParser ()
38
+ arg_parser .add_argument (
39
+ "--skip-login" ,
40
+ action = "store_true" ,
41
+ dest = "skip_login" ,
42
+ default = False ,
43
+ )
44
+
45
+ return arg_parser .parse_args ()
46
+
47
+
30
48
def read_submodules () -> t .Dict [str , Submodule ]:
31
49
"""Read the submodules from .gitmodules (located at the workspace's root).
32
50
@@ -152,9 +170,12 @@ def main() -> None:
152
170
"""Entry point."""
153
171
colorama_init ()
154
172
173
+ namespace = get_namespace ()
174
+
155
175
submodules = read_submodules ()
156
176
157
- login_to_github ()
177
+ if not namespace .skip_login :
178
+ login_to_github ()
158
179
159
180
for name , submodule in submodules .items ():
160
181
fork_repo (name , submodule .url )
Original file line number Diff line number Diff line change @@ -5,4 +5,4 @@ cd "${BASH_SOURCE%/*}"
5
5
6
6
pipenv install --dev
7
7
8
- pipenv run python .
8
+ pipenv run python . " $@ "
You can’t perform that action at this time.
0 commit comments