The draw.io application requires a display to work, which does not exist
in some environments ("headless"). In this case, we can use xvfb
to
emulate a virtual display in place of the physical display.
Arguments
- command
The list that represents the command that should have been executed, in a non-headless environment. This list should be the result of a call to
parse.options
. It must have the following values:exe
,args
, andoutput
.
Value
exe The path to the xvfb-run executable binary.
args The list of command line arguments to be passed to xvfb, including the path to the draw.io executable, the draw.io arguments, and electron arguments for headless mode.
output The path to the image that will result from the execution
of `exe
args
` (including the cache directory, if it was
specified). This is exactly the same as the value in the command
argument.
Details
This method checks that xvfb-run
can be found, and wraps the
command-line call to draw.io as a call to xvfb-run
, with additional
parameters that help draw.io work in headless environments.
The returned value has the same structure as the parse.options
method:
exe
is the path to the executable (in this case, xvfb-run
instead of draw.io), args
are the arguments, and output
is
left unchanged (path to the output file).