mirror of
ssh://git.janware.com/janware/proj/jw-pkg
synced 2026-04-24 09:13:37 +02:00
jw.pkg.App.get_os(): Don't use get-os.sh
Remove get-os.sh from App.py to reduce redunancy. Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
2f157db18d
commit
6483de1a8f
1 changed files with 2 additions and 16 deletions
|
|
@ -351,22 +351,8 @@ class App(Base):
|
|||
return self.__find_dir(name, search_subdirs, search_absdirs, pretty)
|
||||
|
||||
@lru_cache(maxsize=None)
|
||||
def get_os(self, args="") -> str:
|
||||
import subprocess
|
||||
for d in [ self.__projs_root + '/jw-pkg/scripts', '/opt/jw-pkg/bin' ]:
|
||||
script = d + '/get-os.sh'
|
||||
if os.path.isfile(script):
|
||||
cmd = '/bin/bash ' + script
|
||||
if args:
|
||||
cmd = cmd + ' ' + args
|
||||
p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE)
|
||||
(out, rr) = p.communicate()
|
||||
if rr:
|
||||
log(ERR, "failed to run ", cmd)
|
||||
continue
|
||||
out = re.sub('\n', '', out.decode('utf-8'))
|
||||
return out
|
||||
return "linux"
|
||||
def get_os(self) -> str:
|
||||
return self.distro_id + '-' + self.distro_codename
|
||||
|
||||
# TODO: add support for customizing this in project.conf
|
||||
def htdocs_dir(self, project: str) -> str:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue