File tree 2 files changed +8
-4
lines changed
2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -33,8 +33,6 @@ import (
33
33
"arduino.cc/builder/constants"
34
34
"arduino.cc/builder/i18n"
35
35
"arduino.cc/builder/utils"
36
- "crypto/md5"
37
- "encoding/hex"
38
36
"os"
39
37
"path/filepath"
40
38
"strings"
@@ -48,8 +46,7 @@ func (s *GenerateBuildPathIfMissing) Run(context map[string]interface{}) error {
48
46
}
49
47
50
48
sketchLocation := context [constants .CTX_SKETCH_LOCATION ].(string )
51
- md5sumBytes := md5 .Sum ([]byte (sketchLocation ))
52
- md5sum := hex .EncodeToString (md5sumBytes [:])
49
+ md5sum := utils .MD5Sum ([]byte (sketchLocation ))
53
50
54
51
buildPath := filepath .Join (os .TempDir (), "arduino-sketch-" + strings .ToUpper (md5sum ))
55
52
_ , err := os .Stat (buildPath )
Original file line number Diff line number Diff line change @@ -34,6 +34,8 @@ import (
34
34
"arduino.cc/builder/gohasissues"
35
35
"arduino.cc/builder/i18n"
36
36
"arduino.cc/builder/types"
37
+ "crypto/md5"
38
+ "encoding/hex"
37
39
"github.com/go-errors/errors"
38
40
"io/ioutil"
39
41
"os"
@@ -469,3 +471,8 @@ func NULLFile() string {
469
471
}
470
472
return "/dev/null"
471
473
}
474
+
475
+ func MD5Sum (data []byte ) string {
476
+ md5sumBytes := md5 .Sum (data )
477
+ return hex .EncodeToString (md5sumBytes [:])
478
+ }
You can’t perform that action at this time.
0 commit comments