mirror of
https://github.com/onionshare/onionshare.git
synced 2025-06-07 06:13:03 -04:00
Allow tests to find share folders when building .deb
This commit is contained in:
parent
21e1dac2c3
commit
d544a0341f
3 changed files with 9 additions and 4 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -27,6 +27,7 @@ pip-log.txt
|
||||||
.coverage
|
.coverage
|
||||||
.tox
|
.tox
|
||||||
nosetests.xml
|
nosetests.xml
|
||||||
|
.cache
|
||||||
|
|
||||||
# Translations
|
# Translations
|
||||||
*.mo
|
*.mo
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
include LICENSE
|
include LICENSE
|
||||||
include README.md
|
include README.md
|
||||||
include BUILD.md
|
include BUILD.md
|
||||||
include resources/*
|
include share/*
|
||||||
include resources/images/*
|
include share/images/*
|
||||||
include resources/locale/*
|
include share/locale/*
|
||||||
include resources/html/*
|
include share/html/*
|
||||||
include install/onionshare.desktop
|
include install/onionshare.desktop
|
||||||
include install/onionshare.appdata.xml
|
include install/onionshare.appdata.xml
|
||||||
include install/onionshare80.xpm
|
include install/onionshare80.xpm
|
||||||
include install/scripts/onionshare-nautilus.py
|
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):
|
if getattr(sys, 'onionshare_dev_mode', False):
|
||||||
# Look for resources directory relative to python file
|
# 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')
|
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):
|
elif p == 'Linux' and sys.argv and sys.argv[0].startswith(sys.prefix):
|
||||||
# OnionShare is installed systemwide in Linux
|
# OnionShare is installed systemwide in Linux
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue