mirror of
https://github.com/openSUSE/osc.git
synced 2024-11-14 00:06:15 +01:00
Fix running osc in an AppImage by switching to the correct working directory
This commit is contained in:
parent
58c5a3074a
commit
3f2f5f5ab1
@ -226,6 +226,13 @@ def main():
|
|||||||
sys.stdout = os.fdopen(sys.stdout.fileno(), sys.stdout.mode, 1)
|
sys.stdout = os.fdopen(sys.stdout.fileno(), sys.stdout.mode, 1)
|
||||||
sys.stderr = os.fdopen(sys.stderr.fileno(), sys.stderr.mode, 1)
|
sys.stderr = os.fdopen(sys.stderr.fileno(), sys.stderr.mode, 1)
|
||||||
|
|
||||||
|
appimage = os.getenv("APPIMAGE", None)
|
||||||
|
owd = os.getenv("OWD", None)
|
||||||
|
if appimage and owd:
|
||||||
|
# OWD stands for Original Working Directory and we need to switch there when running in an AppImage
|
||||||
|
# https://docs.appimage.org/packaging-guide/environment-variables.html
|
||||||
|
os.chdir(owd)
|
||||||
|
|
||||||
sys.exit(run(commandline.OscMainCommand()))
|
sys.exit(run(commandline.OscMainCommand()))
|
||||||
|
|
||||||
# vim: sw=4 et
|
# vim: sw=4 et
|
||||||
|
Loading…
Reference in New Issue
Block a user