Skip to content

Commit cd4ac2f

Browse files
committed
fix: clean up temp keychain
1 parent 3d68dfa commit cd4ac2f

File tree

1 file changed

+2
-26
lines changed

1 file changed

+2
-26
lines changed

sign.py

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919

2020
secret_url = os.path.expandvars("$SECRET_URL").strip().rstrip("/")
2121
secret_key = os.path.expandvars("$SECRET_KEY")
22-
old_keychain: Optional[str] = None
2322
StrPath = Union[str, Path]
2423

2524

@@ -66,21 +65,6 @@ def rand_str(len: int, seed: Any = None):
6665
return result
6766

6867

69-
def kill_xcode():
70-
return run_process("killall", "Xcode", check=False)
71-
72-
73-
def open_xcode(project: Optional[Path] = None):
74-
if project:
75-
return run_process("xed", str(project))
76-
else:
77-
return run_process("xed")
78-
79-
80-
def debug():
81-
return run_process("./debug.sh", capture=False)
82-
83-
8468
def read_file(file_path: StrPath):
8569
with open(file_path) as f:
8670
return f.read()
@@ -158,12 +142,6 @@ def curl_with_auth(
158142
)
159143

160144

161-
def security_set_default_keychain(keychain: str):
162-
old_keychain = decode_clean(run_process("security", "default-keychain").stdout).strip('"')
163-
run_process("security", "default-keychain", "-s", keychain)
164-
return old_keychain
165-
166-
167145
def security_get_keychain_list():
168146
return map(
169147
lambda x: x.strip('"'),
@@ -1248,17 +1226,15 @@ def run():
12481226
unsigned_ipa = Path("unsigned.ipa")
12491227
node_download(secret_url + f"/jobs/{job_id}/unsigned", unsigned_ipa, capture=False)
12501228

1229+
failed = False
12511230
try:
1252-
failed = False
12531231
run()
12541232
except:
12551233
failed = True
12561234
traceback.print_exc()
12571235
finally:
12581236
print("Cleaning up...")
1259-
if old_keychain:
1260-
security_set_default_keychain(old_keychain)
1261-
security_remove_keychain(keychain_name)
1237+
security_remove_keychain(keychain_name)
12621238
if failed:
12631239
curl_with_auth(f"{secret_url}/jobs/{job_id}/fail")
12641240
sys.exit(1)

0 commit comments

Comments
 (0)