Skip to content

Commit

Permalink
only use the last line of chia version output in installhelper.py (Ch…
Browse files Browse the repository at this point in the history
…ia-Network#8239)

Chia-Network#8234

The warning that is being output by `chia version` is causing confusion
when trying to parse the version.  This change ignores the warning by
only trying to parse the last line of the output as the version.  Other
changes should be considered such as not outputting the warning for
small commands like `--help` and `version`.

```
$ chia version
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@             WARNING: UNPROTECTED SSL FILE!              @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0664 for '/home/altendky/repos/chia-blockchain/mozilla-ca/cacert.pem' are too open. Expected 0644
One or more SSL files were found with permission issues.
Run `chia init --fix-ssl-permissions` to fix issues.
1.2.5.dev0
```
  • Loading branch information
altendky authored Aug 27, 2021
1 parent 64ba38f commit f3be389
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion installhelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def update_version():
version: str = "0.0"
output = subprocess.run(["chia", "version"], capture_output=True)
if output.returncode == 0:
version = str(output.stdout.strip(), "utf-8")
version = str(output.stdout.strip(), "utf-8").splitlines()[-1]

data["version"] = make_semver(version)

Expand Down

0 comments on commit f3be389

Please sign in to comment.