blob: f2c3612958a651b61e05645ac8a2973e55c37ca2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
import os
import subprocess
__version__ = "1.2.2"
IS_FLATPAK = False
if os.path.exists('/app/share/run-as-flatpak'):
IS_FLATPAK = True
IS_PORTABLE = False
portable_path = os.path.join(os.getcwd(), 'is_portable')
if os.path.exists(portable_path):
IS_PORTABLE = True
try:
p = subprocess.Popen('git rev-parse --short=12 HEAD', shell=True,
stdout=subprocess.PIPE, stderr=subprocess.DEVNULL)
node = p.communicate()[0]
if node:
__version__ += '+' + node.decode('utf-8').strip()
except Exception:
pass
|