mirror of
https://github.com/openSUSE/osc.git
synced 2024-12-27 10:16:14 +01:00
Merge pull request #1330 from dmach/fix-AppImage-OWD
Fix running osc in an AppImage by switching to the correct working directory
This commit is contained in:
commit
2bd9142373
@ -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