Исправлен вызов xvfb => xvfb-run
All checks were successful
drawio-export/pipeline/head This commit looks good
drawio-export/pipeline/tag This commit looks good

This commit is contained in:
Алексей Бадяев 2023-04-13 20:11:30 +07:00
parent 2752e80eb3
commit 3890a96812
Signed by: alexey
GPG Key ID: 686FBC1363E4AFAE
2 changed files with 41 additions and 1 deletions

View File

@ -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 {

View File

@ -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) {