mirror of
https://github.com/onionshare/onionshare.git
synced 2025-06-20 12:34:23 -04:00
CLI version of onionshare in OSX now works when symlinked (closes #132)
This commit is contained in:
parent
2ea0c6aef3
commit
ccc8b87b9a
2 changed files with 6 additions and 3 deletions
|
@ -20,6 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
"""
|
"""
|
||||||
import zipimport, os, inspect
|
import zipimport, os, inspect
|
||||||
cwd = os.path.dirname(os.path.realpath(os.path.abspath(inspect.getfile(inspect.currentframe()))))
|
cwd = os.path.dirname(os.path.realpath(os.path.abspath(inspect.getfile(inspect.currentframe()))))
|
||||||
zi = zipimport.zipimporter(cwd+'/lib/python2.7/site-packages.zip')
|
os.chdir(cwd)
|
||||||
|
zi = zipimport.zipimporter('lib/python2.7/site-packages.zip')
|
||||||
onionshare = zi.load_module('onionshare')
|
onionshare = zi.load_module('onionshare')
|
||||||
onionshare.main()
|
onionshare.main()
|
||||||
|
|
|
@ -43,9 +43,11 @@ def get_onionshare_dir():
|
||||||
|
|
||||||
def get_osx_resources_dir():
|
def get_osx_resources_dir():
|
||||||
if get_platform() == 'Darwin':
|
if get_platform() == 'Darwin':
|
||||||
# this is hacky, but in it ultimate ends up returning the absolute path to
|
# this is hacky, but it ultimate ends up returning the absolute path to
|
||||||
# OnionShare.app/Contents/Resources, based on the location of helpers.py
|
# OnionShare.app/Contents/Resources, based on the location of helpers.py
|
||||||
return os.path.dirname(os.path.dirname(os.path.realpath(os.path.abspath(inspect.getfile(inspect.currentframe())))))
|
helpers_path = os.path.realpath(os.path.abspath(inspect.getfile(inspect.currentframe())))
|
||||||
|
osx_resources_dir = os.path.dirname(os.path.dirname(helpers_path))
|
||||||
|
return osx_resources_dir
|
||||||
|
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue