Browse Source

pio: check returncode of the git process

Since the Popen instance won't do that by itself. Handles the case
where there is `git` command present, but it's not a git repo underneath.
pull/2471/head
Maxim Prokhorov 2 years ago
parent
commit
bdd821db86
1 changed files with 5 additions and 4 deletions
  1. +5
    -4
      code/scripts/espurna_utils/version.py

+ 5
- 4
code/scripts/espurna_utils/version.py View File

@ -16,10 +16,11 @@ def app_revision():
def git(*args):
cmd = ["git"]
cmd.extend(args)
proc = subprocess.Popen(
cmd, stderr=subprocess.PIPE, stdout=subprocess.PIPE, universal_newlines=True
)
return proc.stdout.readlines()[0].strip()
result = subprocess.run(cmd, capture_output=True, universal_newlines=True)
result.check_returncode()
return result.stdout.strip()
revision = None
try:


Loading…
Cancel
Save