@@ -28,27 +28,20 @@ type CompileOutput struct {
28
28
}
29
29
30
30
type BuilderResult struct {
31
- BuildPath string `json:"build_path"`
32
- UsedLibraries []* LibInfo `json:"used_libraries"`
31
+ BuildPath string `json:"build_path"`
32
+ UsedLibraries []* Info `json:"used_libraries"`
33
33
}
34
34
35
- // coreInfo contains information regarding the core used during the compile process
36
- type CoreInfo struct {
37
- // corePackager string `json: "CorePackager"`
38
- CoreName string `json:"coreName"`
39
- CoreVersion string `json:"coreVersion"`
40
- }
41
-
42
- // LibInfo contains information regarding the library used during the compile process
43
- type LibInfo struct {
44
- LibName string `json:"name"`
45
- LibVersion string `json:"version"`
35
+ // Info contains information regarding the library or the core used during the compile process
36
+ type Info struct {
37
+ Name string `json:"name"`
38
+ Version string `json:"version"`
46
39
}
47
40
48
41
// returnJson contains information regarding the core and libraries used during the compile process
49
42
type ReturnJson struct {
50
- CoreInfo * CoreInfo `json:"coreInfo"`
51
- LibsInfo []* LibInfo `json:"libsInfo"`
43
+ CoreInfo * Info `json:"coreInfo"`
44
+ LibsInfo []* Info `json:"libsInfo"`
52
45
}
53
46
54
47
// compileCmd represents the compile command
@@ -174,17 +167,17 @@ func parseOutput(cmdOutToParse []byte) ([]*paths.Path, *ReturnJson) {
174
167
175
168
// parseCoreLine takes the line containig info regarding the core and
176
169
// returns a coreInfo object
177
- func parseCoreLine (coreLine string ) * CoreInfo {
170
+ func parseCoreLine (coreLine string ) * Info {
178
171
words := strings .Split (coreLine , " " )
179
172
strCorePath := words [len (words )- 1 ] // last string has the path of the core
180
173
// maybe check if the path is legit before and logrus.Fatal if not
181
174
corePath := paths .New (strCorePath )
182
175
version := corePath .Base ()
183
176
name := corePath .Parent ().Base ()
184
177
logrus .Debugf ("core name: %s, core version: %s" , name , version )
185
- coreInfo := & CoreInfo {
186
- CoreName : name ,
187
- CoreVersion : version ,
178
+ coreInfo := & Info {
179
+ Name : name ,
180
+ Version : version ,
188
181
}
189
182
return coreInfo
190
183
}
0 commit comments