()
| 2158 | |
| 2159 | |
| 2160 | def remove_old_sponsors_copies(tier_key="3", include_final=True): |
| 2161 | config = get_sponsor_tier_config(tier_key) |
| 2162 | if not config: |
| 2163 | return |
| 2164 | |
| 2165 | names = list(config.get("old_root_names") or []) |
| 2166 | if include_final: |
| 2167 | names.insert(0, config["root_name"]) |
| 2168 | |
| 2169 | seen = set() |
| 2170 | for name in names: |
| 2171 | if not name or name in seen: |
| 2172 | continue |
| 2173 | seen.add(name) |
| 2174 | target = os.path.join(HOME_DIR, name) |
| 2175 | _remove_path_if_exists(target) |
| 2176 | |
| 2177 | |
| 2178 | def clone_sponsors_repository(tier_key="3"): |
| 2179 | config = get_sponsor_tier_config(tier_key) |
| 2180 | if not config: |
| 2181 | return False, _("Invalid sponsor tier.") |
| 2182 | |
| 2183 | if not ensure_pkg_command("git", "git"): |
| 2184 | return False, "git could not be installed. Run manually: pkg install git" |
| 2185 |
no test coverage detected