MCPcopy
hub / github.com/pluwen/awesome-testflight-link / main

Function main

scripts/del_link.py:6–39  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4from utils import renew_readme, load_links, save_links
5
6def main():
7 if len(sys.argv) < 2:
8 print("Usage: python del_link.py <testflight_link>")
9 print()
10 print("Examples:")
11 print(" python3 del_link.py NXLBigzY")
12 print(" python3 del_link.py https://testflight.apple.com/join/NXLBigzY")
13 sys.exit(1)
14
15 testflight_link = sys.argv[1]
16
17 # Extract link ID from URL if needed
18 link_id_match = re.search(r"join/(.*)$", testflight_link, re.I)
19 if link_id_match:
20 testflight_link = link_id_match.group(1)
21
22 links_data = load_links()
23 all_links = links_data.get("_links", {})
24
25 if testflight_link not in all_links:
26 print(f"[warn] Link {testflight_link} not found")
27 return
28
29 link_info = all_links[testflight_link]
30 app_name = link_info.get("app_name", "Unknown")
31
32 # Delete the entire link
33 del links_data["_links"][testflight_link]
34 print(f"[info] Deleted '{app_name}' ({testflight_link})")
35
36 save_links(links_data)
37
38 # Regenerate README
39 renew_readme()
40
41if __name__ == "__main__":
42 main()

Callers 1

del_link.pyFile · 0.70

Calls 3

load_linksFunction · 0.90
save_linksFunction · 0.90
renew_readmeFunction · 0.90

Tested by

no test coverage detected