@@ -46,6 +46,9 @@ type GenericBackend struct {
4646 TokenChaincodePath string
4747 TokenChaincodeParamsReplaceSuffix string
4848 TokenPlatform common2.TokenPlatform
49+
50+ // SkipPaths is a list of substrings that if contained in a path will make that path to be skipped
51+ SkipPaths []string
4952}
5053
5154func NewDefaultGenericBackend (tokenPlatform common2.TokenPlatform ) * GenericBackend {
@@ -142,6 +145,14 @@ func (p *GenericBackend) UpdatePublicParams(tms *topology3.TMS, ppRaw []byte) {
142145 logger .Debugf ("replace [%s:%s]? Yes, this is tcc params" , filePath , fileName )
143146 return "" , paramsFile .Bytes ()
144147 }
148+
149+ for _ , skipPath := range p .SkipPaths {
150+ if strings .Contains (filePath , skipPath ) {
151+ logger .Debugf ("skipping [%s:%s]? Yes" , filePath , fileName )
152+ return "" , []byte {0 }
153+ }
154+ }
155+
145156 return "" , nil
146157 },
147158 )
@@ -175,6 +186,7 @@ func (p *GenericBackend) tccSetup(tms *topology3.TMS, cc *topology.ChannelChainc
175186 gomega .Expect (os .MkdirAll (packageDir , 0766 )).ToNot (gomega .HaveOccurred ())
176187 paramsFile := PublicParamsTemplate (ppRaw )
177188 port := p .TokenPlatform .GetContext ().ReservePort ()
189+
178190 err = packager .New ().PackageChaincode (
179191 cc .Chaincode .Path ,
180192 cc .Chaincode .Lang ,
@@ -188,6 +200,13 @@ func (p *GenericBackend) tccSetup(tms *topology3.TMS, cc *topology.ChannelChainc
188200 return "" , paramsFile .Bytes ()
189201 }
190202
203+ for _ , skipPath := range p .SkipPaths {
204+ if strings .Contains (filePath , skipPath ) {
205+ logger .Debugf ("skipping [%s:%s]? Yes" , filePath , fileName )
206+ return "" , []byte {0 }
207+ }
208+ }
209+
191210 // Is connection.json?
192211 if filePath == fileName && filePath == "connection.json" {
193212 // Connection holds the path and type for a chaincode package
0 commit comments