File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -33,8 +33,6 @@ import (
3333 "arduino.cc/builder/constants"
3434 "arduino.cc/builder/i18n"
3535 "arduino.cc/builder/utils"
36- "crypto/md5"
37- "encoding/hex"
3836 "os"
3937 "path/filepath"
4038 "strings"
@@ -48,8 +46,7 @@ func (s *GenerateBuildPathIfMissing) Run(context map[string]interface{}) error {
4846 }
4947
5048 sketchLocation := context [constants .CTX_SKETCH_LOCATION ].(string )
51- md5sumBytes := md5 .Sum ([]byte (sketchLocation ))
52- md5sum := hex .EncodeToString (md5sumBytes [:])
49+ md5sum := utils .MD5Sum ([]byte (sketchLocation ))
5350
5451 buildPath := filepath .Join (os .TempDir (), "arduino-sketch-" + strings .ToUpper (md5sum ))
5552 _ , err := os .Stat (buildPath )
Original file line number Diff line number Diff line change @@ -34,6 +34,8 @@ import (
3434 "arduino.cc/builder/gohasissues"
3535 "arduino.cc/builder/i18n"
3636 "arduino.cc/builder/types"
37+ "crypto/md5"
38+ "encoding/hex"
3739 "github.com/go-errors/errors"
3840 "io/ioutil"
3941 "os"
@@ -469,3 +471,8 @@ func NULLFile() string {
469471 }
470472 return "/dev/null"
471473}
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