Исправлен вызов xvfb => xvfb-run
This commit is contained in:
parent
2752e80eb3
commit
3890a96812
@ -106,7 +106,7 @@ type ReadDirFunc func(string) ([]os.DirEntry, error)
|
|||||||
// Путь к приложению drawio
|
// Путь к приложению drawio
|
||||||
func (opts Options) App() string {
|
func (opts Options) App() string {
|
||||||
if opts.EnableXvfb {
|
if opts.EnableXvfb {
|
||||||
return "xvfb"
|
return "xvfb-run"
|
||||||
}
|
}
|
||||||
app := opts.Application
|
app := opts.Application
|
||||||
if len(app) == 0 {
|
if len(app) == 0 {
|
||||||
|
@ -64,6 +64,46 @@ func TestOptions(t *testing.T) {
|
|||||||
"--enable-plugins",
|
"--enable-plugins",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "png with xvfb",
|
||||||
|
opts: []Option{
|
||||||
|
WithAppPath("/usr/local/bin/drawio"),
|
||||||
|
WithXvfb(),
|
||||||
|
WithOutput("/tmp/images/"),
|
||||||
|
WithFormat(PNG),
|
||||||
|
WithRecursive(),
|
||||||
|
WithRemovePageSuffix(),
|
||||||
|
WithQuality(100),
|
||||||
|
WithTransparent(),
|
||||||
|
WithEmbedDiagram(),
|
||||||
|
WithEmbedSvgImages(),
|
||||||
|
WithBorder(1),
|
||||||
|
WithScale(120),
|
||||||
|
WithWidth(800),
|
||||||
|
WithHeight(600),
|
||||||
|
WithCrop(),
|
||||||
|
WithUncompressed(),
|
||||||
|
WithEnablePlugins(),
|
||||||
|
},
|
||||||
|
app: "xvfb-run",
|
||||||
|
outdir: "/tmp/images/",
|
||||||
|
outext: ".png",
|
||||||
|
args: []string{
|
||||||
|
"-a", "-l", "/usr/local/bin/drawio",
|
||||||
|
"--format", "png",
|
||||||
|
"--quality", "100",
|
||||||
|
"--transparent",
|
||||||
|
"--embed-diagram",
|
||||||
|
"--embed-svg-images",
|
||||||
|
"--border", "1",
|
||||||
|
"--scale", "120",
|
||||||
|
"--width", "800",
|
||||||
|
"--height", "600",
|
||||||
|
"--crop",
|
||||||
|
"--uncompressed",
|
||||||
|
"--enable-plugins",
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
for _, test := range testData {
|
for _, test := range testData {
|
||||||
t.Run(test.name, func(t *testing.T) {
|
t.Run(test.name, func(t *testing.T) {
|
||||||
|
Loading…
Reference in New Issue
Block a user