Skip to content

Commit

Permalink
Merge pull request #397 from andyjones/develop
Browse files Browse the repository at this point in the history
Safety 2.x fails when git is not installed
  • Loading branch information
cb22 committed Jul 18, 2022
2 parents fac16b6 + 2f0bbd5 commit 00d4633
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion safety/util.py
Expand Up @@ -213,7 +213,10 @@ def build_telemetry_data(telemetry=True):
def build_git_data():
import subprocess

is_git = subprocess.run(["git", "rev-parse", "--is-inside-work-tree"], stdout=subprocess.PIPE).stdout.decode('utf-8').strip()
try:
is_git = subprocess.run(["git", "rev-parse", "--is-inside-work-tree"], stdout=subprocess.PIPE).stdout.decode('utf-8').strip()
except Exception:
is_git = False

if is_git == "true":
result = {
Expand Down

0 comments on commit 00d4633

Please sign in to comment.