From c558caba5b606586e2e1b181839cc718eca559a0 Mon Sep 17 00:00:00 2001 From: Maxim Shulga Date: Sun, 2 Aug 2026 15:55:55 -0700 Subject: [PATCH] Keep the working directory off the CLI wrapper's search paths Neither LD_LIBRARY_PATH nor PYTHONPATH is set in the base image, so appending them unconditionally left a trailing ':'. An empty entry in a colon-separated search path means the working directory, and Python resolved it to /dsc on sys.path. Append the separator only when the variable is already non-empty. Reported by the automated review on #11. --- Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index c6958c3..5eec5f0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -29,9 +29,9 @@ RUN curl -fsSL -o /tmp/seaf-cli.AppImage "$SEAFILE_CLI_URL" && \ RUN printf '%s\n' \ '#!/bin/sh' \ 'APPDIR=/opt/seafile-cli' \ - 'export PATH="$APPDIR/usr/bin:$PATH"' \ - 'export LD_LIBRARY_PATH="$APPDIR/usr/lib:$LD_LIBRARY_PATH"' \ - 'export PYTHONPATH="$APPDIR/usr/lib/python3.9/site-packages:$PYTHONPATH"' \ + 'export PATH="$APPDIR/usr/bin${PATH:+:$PATH}"' \ + 'export LD_LIBRARY_PATH="$APPDIR/usr/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"' \ + 'export PYTHONPATH="$APPDIR/usr/lib/python3.9/site-packages${PYTHONPATH:+:$PYTHONPATH}"' \ 'exec python3 "$APPDIR/usr/bin/seaf-cli" "$@"' \ > /usr/local/bin/seaf-cli && \ chmod +x /usr/local/bin/seaf-cli