mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-15 12:03:31 +01:00
projects.py proj-dir: Fall back on /opt
Search in /opt, if a project is not found in projects-dir Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
924a1df3c4
commit
94e1c29ede
1 changed files with 5 additions and 2 deletions
|
|
@ -10,7 +10,6 @@ import sys
|
|||
import argparse
|
||||
import pwd
|
||||
import time
|
||||
import pathlib
|
||||
from os.path import isfile
|
||||
from os.path import isdir
|
||||
from os.path import expanduser
|
||||
|
|
@ -104,7 +103,11 @@ class Projects(object):
|
|||
def proj_dir(self, name):
|
||||
if name == self.top_name:
|
||||
return self.topdir
|
||||
return self.projs_root + '/' + name
|
||||
for d in [ self.projs_root, '/opt' ]:
|
||||
r = d + '/' + name
|
||||
if os.path.exists(r):
|
||||
return r
|
||||
raise Exception('No project path found for module "{}"'.format(name))
|
||||
|
||||
def re_section(self, name):
|
||||
return re.compile('[' + name + ']'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue