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

View File

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

Binary file not shown.