]> git.seodisparate.com - AnotherAURHelper/commitdiff
Fix function missing parameter
authorStephen Seo <seo.disparate@gmail.com>
Fri, 17 Nov 2023 11:46:58 +0000 (20:46 +0900)
committerStephen Seo <seo.disparate@gmail.com>
Fri, 17 Nov 2023 11:46:58 +0000 (20:46 +0900)
By putting main into a function, other_state is no longer a global. Some
functions depended on this global dict, so pass it as a parameter
instead.

update.py

index 5a32e93d1d09ae29a0e1a18f87df10ef9a924871..15c1aa5d78128859757fb937ec38332adbc6a8c9 100755 (executable)
--- a/update.py
+++ b/update.py
@@ -1664,7 +1664,10 @@ def build_print_pkg_info(pkgs: tuple[str], other_state: dict[str, any]):
 
 
 def test_gpg_passphrase(
-    signing_gpg_dir: str, signing_key_fp: str, passphrase: str
+    signing_gpg_dir: str,
+    signing_key_fp: str,
+    passphrase: str,
+    other_state: dict[str, any],
 ):
     """Checks if the given gpg passphrase works with the gpg signing key."""
 
@@ -1886,6 +1889,7 @@ def main():
                 other_state["signing_gpg_dir"],
                 other_state["signing_gpg_key_fp"],
                 other_state["signing_gpg_pass"],
+                other_state,
             ):
                 sys.exit(1)
     elif args.config:
@@ -1987,6 +1991,7 @@ def main():
                 other_state["signing_gpg_dir"],
                 other_state["signing_gpg_key_fp"],
                 other_state["signing_gpg_pass"],
+                other_state,
             ):
                 sys.exit(1)
         if "editor" in d: