Skip to content

Commit 9c74086

Browse files
committed
store sketch location in the sketch struct
1 parent 34474dc commit 9c74086

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

arduino/builder/sketch_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ func TestLoadSketchFolder(t *testing.T) {
5555
assert.Nil(t, err)
5656
assert.NotNil(t, s)
5757
assert.Equal(t, mainFilePath, s.MainFile.Path)
58+
assert.Equal(t, sketchPath, s.LocationPath)
5859
assert.Len(t, s.OtherSketchFiles, 2)
5960
assert.Equal(t, "old.pde", filepath.Base(s.OtherSketchFiles[0].Path))
6061
assert.Equal(t, "other.ino", filepath.Base(s.OtherSketchFiles[1].Path))

arduino/sketch/sketch.go

+2
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ func (ibn ItemByPath) Less(i, j int) bool { return ibn[i].Path < ibn[j].Path }
5454
// Sketch holds all the files composing a sketch
5555
type Sketch struct {
5656
MainFile *Item
57+
LocationPath string
5758
OtherSketchFiles []*Item
5859
AdditionalFiles []*Item
5960
}
@@ -108,6 +109,7 @@ func New(sketchFolderPath, mainFilePath, buildPath string, allFilesPaths []strin
108109

109110
return &Sketch{
110111
MainFile: mainFile,
112+
LocationPath: sketchFolderPath,
111113
OtherSketchFiles: otherSketchFiles,
112114
AdditionalFiles: additionalFiles,
113115
}, nil

arduino/sketch/sketch_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ func TestNew(t *testing.T) {
6262
sketch, err := sketch.New(sketchFolderPath, mainFilePath, "", allFilesPaths)
6363
assert.Nil(t, err)
6464
assert.Equal(t, mainFilePath, sketch.MainFile.Path)
65+
assert.Equal(t, sketchFolderPath, sketch.LocationPath)
6566
assert.Len(t, sketch.OtherSketchFiles, 0)
6667
assert.Len(t, sketch.AdditionalFiles, 1)
6768
}

0 commit comments

Comments
 (0)