Skip to content

Commit

Permalink
fix: add command file-close: at the end of conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
galihrivanto committed Jan 31, 2021
1 parent bd85f00 commit a7a279d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ const (

// defines common errors in library
var (
ErrCommandNotReady = errors.New("inkscape not available")
ErrCommandNotAvailable = errors.New("inkscape not available")
ErrCommandNotReady = errors.New("inkscape not ready")
)

var (
Expand Down Expand Up @@ -86,7 +87,7 @@ func (p *Proxy) runBackground(ctx context.Context, commandPath string, vars ...s
func (p *Proxy) Run(args ...string) error {
commandPath, err := exec.LookPath(p.options.commandName)
if err != nil {
return err
return ErrCommandNotAvailable
}

log.Println("proxy:", commandPath)
Expand Down Expand Up @@ -142,7 +143,7 @@ func (p *Proxy) waitReady(timeout time.Duration) error {

func (p *Proxy) sendCommand(b []byte) ([]byte, error) {
log.Println("proxy: wait ready")
err := p.waitReady(5 * time.Second)
err := p.waitReady(30 * time.Second)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -210,6 +211,7 @@ func (p *Proxy) Svg2Pdf(svgIn, pdfOut string) error {
"file-open:"+svgIn,
"export-filename:"+pdfOut,
"export-do",
"file-close:",
)
if err != nil {
return err
Expand Down

0 comments on commit a7a279d

Please sign in to comment.