Skip to content

Commit

Permalink
Merge pull request #1330 from dmach/fix-AppImage-OWD
Browse files Browse the repository at this point in the history
Fix running osc in an AppImage by switching to the correct working directory
  • Loading branch information
dmach committed May 23, 2023
2 parents 58c5a30 + 3f2f5f5 commit 2bd9142
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions osc/babysitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 2bd9142

Please sign in to comment.