only regenerate pdf if it has been deleted

This commit is contained in:
Stani 2015-07-11 19:19:03 +02:00
parent 99aee45045
commit a5918dc963
3 changed files with 9 additions and 8 deletions

View File

@ -7,6 +7,7 @@
package draw2dpdf_test package draw2dpdf_test
import ( import (
"os"
"testing" "testing"
"github.com/llgcode/draw2d" "github.com/llgcode/draw2d"
@ -25,13 +26,13 @@ func test(t *testing.T, draw sample) {
t.Errorf("Drawing %q failed: %v", output, err) t.Errorf("Drawing %q failed: %v", output, err)
return return
} }
/*
// Save to pdf only if it doesn't exist because of git // Save to pdf only if it doesn't exist because of git
if _, err = os.Stat(output); err == nil { if _, err = os.Stat(output); err == nil {
t.Skipf("Saving %q skipped, as it exists already. (Git would consider it modified.)", output) t.Skipf("Saving %q skipped, as it exists already. (Git would consider it modified.)", output)
return return
} }
*/
err = draw2dpdf.SaveToPdfFile(output, dest) err = draw2dpdf.SaveToPdfFile(output, dest)
if err != nil { if err != nil {
t.Errorf("Saving %q failed: %v", output, err) t.Errorf("Saving %q failed: %v", output, err)

View File

@ -2,4 +2,4 @@
* *
# Except this file # Except this file
!.gitignore !.gitignore
!geometry.png !geometry.*

Binary file not shown.