File tree 3 files changed +30
-63
lines changed
3 files changed +30
-63
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,10 @@ import (
39
39
type ContainerMergeCopySketchFiles struct {}
40
40
41
41
func (s * ContainerMergeCopySketchFiles ) Run (ctx * types.Context ) error {
42
+ offset , source := bldr .MergeSketchSources (types .SketchFromLegacy (ctx .Sketch ))
43
+ ctx .LineOffset = offset
44
+ ctx .Source = source
45
+
42
46
if err := new (SketchSourceMerger ).Run (ctx ); err != nil {
43
47
return i18n .WrapError (err )
44
48
}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -148,6 +148,32 @@ func SketchToLegacy(sketch *sketch.Sketch) *Sketch {
148
148
return s
149
149
}
150
150
151
+ func SketchFromLegacy (s * Sketch ) * sketch.Sketch {
152
+ others := []* sketch.Item {}
153
+ for _ , f := range s .OtherSketchFiles {
154
+ if i , err := sketch .NewItem (f .Name .String ()); err == nil {
155
+ others = append (others , i )
156
+ }
157
+ }
158
+
159
+ additional := []* sketch.Item {}
160
+ for _ , f := range s .AdditionalFiles {
161
+ if i , err := sketch .NewItem (f .Name .String ()); err == nil {
162
+ additional = append (additional , i )
163
+ }
164
+ }
165
+
166
+ return & sketch.Sketch {
167
+ MainFile : & sketch.Item {
168
+ Path : s .MainFile .Name .String (),
169
+ Source : []byte (s .MainFile .Source ),
170
+ },
171
+ LocationPath : s .MainFile .Name .Parent ().String (),
172
+ OtherSketchFiles : others ,
173
+ AdditionalFiles : additional ,
174
+ }
175
+ }
176
+
151
177
type PlatforKeysRewrite struct {
152
178
Rewrites []PlatforKeyRewrite
153
179
}
You can’t perform that action at this time.
0 commit comments