added app_version to non snap env

This commit is contained in:
Adnan Hodzic 2020-09-11 00:10:57 +02:00
parent 7f0ad729c9
commit d3a767626a
2 changed files with 7 additions and 1 deletions

View File

@ -35,6 +35,7 @@ def main(monitor, live, daemon, install, log, debug):
if os.getenv("PKG_MARKER") == "SNAP" and dcheck == "enabled":
while True:
root_check()
footer()
gov_check()
cpufreqctl()
distro_info()
@ -90,9 +91,11 @@ def main(monitor, live, daemon, install, log, debug):
root_check()
footer()
distro_info()
print("")
if os.getenv('PKG_MARKER') == "SNAP":
print("Snap package: yes")
else:
app_version()
print("Snap package: no")
print("")
python_info()

View File

@ -12,7 +12,7 @@ import warnings
from math import isclose
from pathlib import Path
from pprint import pformat
from subprocess import getoutput, call, run
from subprocess import getoutput, call, run, check_output
import psutil
import distro
@ -30,6 +30,9 @@ SCRIPTS_DIR = Path("/usr/local/share/auto-cpufreq/scripts/")
ALL_GOVERNORS = ("performance", "ondemand", "conservative", "schedutil", "userspace", "powersave")
CPUS = os.cpu_count()
# ToDo: read version from snap/snapcraft.yaml and write to $SNAP/version for use with snap installs
def app_version():
print("Build git commit:", check_output(["git", "describe", "--always"]).strip().decode())
def turbo(value: bool = None):
"""