Skip to content

Commit

Permalink
feat: support drawio app > 16
Browse files Browse the repository at this point in the history
  • Loading branch information
rlespinasse authored Oct 20, 2022
1 parent 9003372 commit ad59b9c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 14 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ FROM rust:buster as drawio-exporter-installer

RUN cargo install --version 1.2.0 drawio-exporter

FROM rlespinasse/drawio-desktop-headless:1.5.0
FROM rlespinasse/drawio-desktop-headless:v1.7.0

WORKDIR /opt/drawio-exporter
COPY --from=drawio-exporter-installer /usr/local/cargo/bin/drawio-exporter .
COPY scripts/* ./

# disable timeout capabilities since it's a batch
ENV DRAWIO_DESKTOP_COMMAND_TIMEOUT 0
ENV DRAWIO_DESKTOP_RUNNER_COMMAND_LINE "/opt/drawio-exporter/runner-no-security-warnings.sh"
ENV DRAWIO_DESKTOP_RUNNER_COMMAND_LINE "/opt/drawio-exporter/runner.sh"
ENV DRAWIO_DESKTOP_EXECUTABLE_PATH /opt/drawio-exporter/drawio-exporter

WORKDIR /data
Expand Down
15 changes: 8 additions & 7 deletions scripts/runner.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
#!/usr/bin/env bash
set -e

filter_electron_security_warnings() {
while read -r line; do
echo "$line" | grep -v "is deprecated and will be changing"
done
}

if [ "${ELECTRON_DISABLE_SECURITY_WARNINGS}" == "true" ]; then
"$DRAWIO_DESKTOP_EXECUTABLE_PATH" --drawio-desktop-headless "$@" 2> >(filter_electron_security_warnings)
"$DRAWIO_DESKTOP_EXECUTABLE_PATH" --drawio-desktop-headless "$@" 3>&1 >&2 2>&3 3>&- |
grep -v "Failed to connect to socket" |
grep -v "Could not parse server address" |
grep -v "Floss manager not present" |
grep -v "Exiting GPU process" |
grep -v "called with multiple threads" |
grep -v "extension not supported" |
grep -v "Failed to send GpuControl.CreateCommandBuffer"
else
"$DRAWIO_DESKTOP_EXECUTABLE_PATH" --drawio-desktop-headless "$@" 2>&1
fi
6 changes: 3 additions & 3 deletions tests/expected/option-git-ref_need_on-changes.log
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
error: The following required arguments were not provided:
--on-changes
error: The following required arguments were not provided:
--on-changes

USAGE:
drawio-exporter --border <border> --quality <quality> --drawio-desktop-headless --output <folder> --format <format> --git-ref <reference> --on-changes

For more information try --help
For more information try --help
4 changes: 2 additions & 2 deletions tests/expected/print_help_if_wrong_argument.log
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
error: Found argument '--wrong-argument' which wasn't expected, or isn't valid in this context
error: Found argument '--wrong-argument' which wasn't expected, or isn't valid in this context

USAGE:
drawio-exporter --drawio-desktop-headless

For more information try --help
For more information try --help

0 comments on commit ad59b9c

Please sign in to comment.