@@ -40,6 +40,8 @@ const (
40
40
// Unmanaged is for libraries set manually by the user in the CLI command or from the gRPC function.
41
41
// Ideally it's used for `libraries` outside folders managed by the CLI.
42
42
Unmanaged
43
+ // Sketch is for libraries that are part of the sketch (inside the `libraries` subfolder of the sketch).
44
+ Sketch
43
45
)
44
46
45
47
func (d * LibraryLocation ) String () string {
@@ -54,6 +56,8 @@ func (d *LibraryLocation) String() string {
54
56
return "user"
55
57
case Unmanaged :
56
58
return "unmanaged"
59
+ case Sketch :
60
+ return "sketch"
57
61
default :
58
62
panic (fmt .Sprintf ("invalid LibraryLocation value %d" , * d ))
59
63
}
@@ -86,6 +90,9 @@ func (d *LibraryLocation) UnmarshalJSON(b []byte) error {
86
90
case "unmanaged" :
87
91
* d = Unmanaged
88
92
return nil
93
+ case "sketch" :
94
+ * d = Sketch
95
+ return nil
89
96
default :
90
97
return errors .New (i18n .Tr ("invalid library location: %s" , s ))
91
98
}
@@ -104,6 +111,8 @@ func (d *LibraryLocation) ToRPCLibraryLocation() rpc.LibraryLocation {
104
111
return rpc .LibraryLocation_LIBRARY_LOCATION_USER
105
112
case Unmanaged :
106
113
return rpc .LibraryLocation_LIBRARY_LOCATION_UNMANAGED
114
+ case Sketch :
115
+ return rpc .LibraryLocation_LIBRARY_LOCATION_SKETCH
107
116
default :
108
117
panic (fmt .Sprintf ("invalid LibraryLocation value %d" , * d ))
109
118
}
@@ -122,6 +131,8 @@ func FromRPCLibraryLocation(l rpc.LibraryLocation) LibraryLocation {
122
131
return User
123
132
case rpc .LibraryLocation_LIBRARY_LOCATION_UNMANAGED :
124
133
return Unmanaged
134
+ case rpc .LibraryLocation_LIBRARY_LOCATION_SKETCH :
135
+ return Sketch
125
136
default :
126
137
panic (fmt .Sprintf ("invalid rpc.LibraryLocation value %d" , l ))
127
138
}
0 commit comments