mirror of
https://github.com/openSUSE/osc.git
synced 2024-11-10 14:56:14 +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.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()))
|
||||
|
||||
# vim: sw=4 et
|
||||
|
Loading…
Reference in New Issue
Block a user