mirror of
https://github.com/onionshare/onionshare.git
synced 2024-10-01 01:35:40 -04:00
Allow tests to find share folders when building .deb
This commit is contained in:
parent
21e1dac2c3
commit
d544a0341f
1
.gitignore
vendored
1
.gitignore
vendored
@ -27,6 +27,7 @@ pip-log.txt
|
||||
.coverage
|
||||
.tox
|
||||
nosetests.xml
|
||||
.cache
|
||||
|
||||
# Translations
|
||||
*.mo
|
||||
|
@ -1,11 +1,12 @@
|
||||
include LICENSE
|
||||
include README.md
|
||||
include BUILD.md
|
||||
include resources/*
|
||||
include resources/images/*
|
||||
include resources/locale/*
|
||||
include resources/html/*
|
||||
include share/*
|
||||
include share/images/*
|
||||
include share/locale/*
|
||||
include share/html/*
|
||||
include install/onionshare.desktop
|
||||
include install/onionshare.appdata.xml
|
||||
include install/onionshare80.xpm
|
||||
include install/scripts/onionshare-nautilus.py
|
||||
include test/*.py
|
||||
|
@ -69,6 +69,9 @@ def get_resource_path(filename):
|
||||
if getattr(sys, 'onionshare_dev_mode', False):
|
||||
# Look for resources directory relative to python file
|
||||
prefix = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))), 'share')
|
||||
if not os.path.exists(prefix):
|
||||
# While running tests during stdeb bdist_deb, look 3 directories up for the share folder
|
||||
prefix = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(prefix)))), 'share')
|
||||
|
||||
elif p == 'Linux' and sys.argv and sys.argv[0].startswith(sys.prefix):
|
||||
# OnionShare is installed systemwide in Linux
|
||||
|
Loading…
Reference in New Issue
Block a user