diff --git a/contrib/docker/entrypoint.sh b/contrib/docker/entrypoint.sh index e338df2a..3e1da8fd 100755 --- a/contrib/docker/entrypoint.sh +++ b/contrib/docker/entrypoint.sh @@ -104,6 +104,13 @@ if [ "${ONEDRIVE_DISPLAY_CONFIG:=0}" == "1" ]; then ARGS=(--display-running-config ${ARGS[@]}) fi +# Tell client to use sync single dir option +if [ -n "${ONEDRIVE_SINGLE_DIRECTORY:=""}" ]; then + echo "# We are synchronizing in single-directory mode" + echo "# Adding --single-directory ARG" + ARGS=(--single-directory \"${ONEDRIVE_SINGLE_DIRECTORY}\" ${ARGS[@]}) +fi + if [ ${#} -gt 0 ]; then ARGS=("${@}") fi diff --git a/docs/Docker.md b/docs/Docker.md index 06d69561..5bb18256 100644 --- a/docs/Docker.md +++ b/docs/Docker.md @@ -196,8 +196,8 @@ docker run $firstRun --restart unless-stopped --name onedrive -v onedrive_conf:/ ## Environment Variables -| Variable | Purpose | Sample Value | -| ---------------- | --------------------------------------------------- |:-------------:| +| Variable | Purpose | Sample Value | +| ---------------- | --------------------------------------------------- |:--------------------------------------------------------------------------------------------------------------------------------:| | ONEDRIVE_UID | UserID (UID) to run as | 1000 | | ONEDRIVE_GID | GroupID (GID) to run as | 1000 | | ONEDRIVE_VERBOSE | Controls "--verbose" switch on onedrive sync. Default is 0 | 1 | @@ -211,6 +211,7 @@ docker run $firstRun --restart unless-stopped --name onedrive -v onedrive_conf:/ | ONEDRIVE_AUTHFILES | Controls "--auth-files" option. Default is "" | "authUrl:responseUrl" | | ONEDRIVE_AUTHRESPONSE | Controls "--auth-response" option. Default is "" | See [here](https://github.com/abraunegg/onedrive/blob/master/docs/USAGE.md#authorize-the-application-with-your-onedrive-account) | | ONEDRIVE_DISPLAY_CONFIG | Controls "--display-running-config" switch on onedrive sync. Default is 0 | 1 | +| ONEDRIVE_SINGLE_DIRECTORY | Controls "--single-directory" option. Default = "" | "mydir" | ### Usage Examples **Verbose Output:** diff --git a/docs/Podman.md b/docs/Podman.md index 3d4c72c5..256309b7 100644 --- a/docs/Podman.md +++ b/docs/Podman.md @@ -195,7 +195,7 @@ podman run -it --restart unless-stopped --name onedrive_work \ ``` ## Environment Variables -| Variable | Purpose | Sample Value | +| Variable | Purpose | Sample Value | | ---------------- | --------------------------------------------------- |:-------------:| | ONEDRIVE_UID | UserID (UID) to run as | 1000 | | ONEDRIVE_GID | GroupID (GID) to run as | 1000 | @@ -210,6 +210,7 @@ podman run -it --restart unless-stopped --name onedrive_work \ | ONEDRIVE_AUTHFILES | Controls "--auth-files" option. Default is "" | "authUrl:responseUrl" | | ONEDRIVE_AUTHRESPONSE | Controls "--auth-response" option. Default is "" | See [here](https://github.com/abraunegg/onedrive/blob/master/docs/USAGE.md#authorize-the-application-with-your-onedrive-account) | | ONEDRIVE_DISPLAY_CONFIG | Controls "--display-running-config" switch on onedrive sync. Default is 0 | 1 | +| ONEDRIVE_SINGLE_DIRECTORY | Controls "--single-directory" option. Default = "" | "mydir" | ### Usage Examples **Verbose Output:**