MCPcopy Create free account
hub / github.com/dedsec1121fk/DedSec / run_process

Function run_process

Scripts/Settings.py:1159–1172  ·  view source on GitHub ↗

Safer subprocess helper for commands that do not need shell expansion.

(command, cwd=None, capture=True, check=False)

Source from the content-addressed store, hash-verified

1157
1158def update_dedsec(repo_url=REPO_URL_SOURCE_1, repo_api_url=REPO_API_URL_SOURCE_1):
1159 repo_size = get_github_repo_size(repo_api_url)
1160 print(f"[+] {_('GitHub repository size')}: {repo_size}")
1161 existing_dedsec_path = find_dedsec()
1162 update_changed = False
1163 update_error = None
1164 try:
1165 if existing_dedsec_path:
1166 branch = git_remote_default_branch(repo_url, cwd=existing_dedsec_path)
1167 subprocess.run(
1168 [shutil.which("git") or "git", "remote", "set-url", "origin", repo_url],
1169 cwd=existing_dedsec_path, check=False,
1170 )
1171 fetch = subprocess.run(
1172 [shutil.which("git") or "git", "fetch", "--prune", "origin", branch],
1173 cwd=existing_dedsec_path, capture_output=True, text=True, check=False,
1174 )
1175 if fetch.returncode != 0:

Callers 6

ensure_pkg_commandFunction · 0.70
github_auth_statusFunction · 0.70
github_current_usernameFunction · 0.70
github_auth_tokenFunction · 0.70
connect_github_accountFunction · 0.70

Calls 1

runMethod · 0.45

Tested by

no test coverage detected