File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed
packages/cli/src/commands Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -234,20 +234,19 @@ export default class InitCommand extends Command {
234234
235235 const protocolInstance = new Protocol ( protocol as ProtocolName ) ;
236236
237- if ( fromSubgraph && protocolInstance . isComposedSubgraph ( ) ) {
238- this . error ( '--protocol must be subgraph when using --from-subgraph' ) ;
239- }
240-
241- if ( ! fromSubgraph && protocolInstance . isComposedSubgraph ( ) ) {
237+ if ( fromSubgraph && ! protocolInstance . isComposedSubgraph ( ) ) {
242238 this . error ( '--protocol can only be subgraph when using --from-subgraph' ) ;
243239 }
244240
245- if ( fromSubgraph && ! protocolInstance . isComposedSubgraph ( ) ) {
246- this . error ( '--protocol can only be subgraph when using --from-subgraph' ) ;
241+ if (
242+ fromContract &&
243+ ( protocolInstance . isComposedSubgraph ( ) || protocolInstance . isSubstreams ( ) )
244+ ) {
245+ this . error ( '--protocol cannot be subgraph or substreams when using --from-contract' ) ;
247246 }
248247
249- if ( fromContract && protocolInstance . isComposedSubgraph ( ) ) {
250- this . error ( '--protocol can only be subgraph when using --from-subgraph ' ) ;
248+ if ( spkgPath && ! protocolInstance . isSubstreams ( ) ) {
249+ this . error ( '--protocol can only be substreams when using --spkg ' ) ;
251250 }
252251
253252 // Only fetch contract info and ABI for non-source-subgraph cases
You can’t perform that action at this time.
0 commit comments