Skip to content

Commit

Permalink
git may not be installed
Browse files Browse the repository at this point in the history
  • Loading branch information
andyjones committed Jul 18, 2022
1 parent fac16b6 commit 2f0bbd5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion safety/util.py
Original file line number Diff line number Diff line change
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 2f0bbd5

Please sign in to comment.