File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed
packages/cli/src/commands Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -84,15 +84,6 @@ export default class AddCommand extends Command {
8484 let startBlock = parseInt ( startBlockFlag ?? '' ) . toString ( ) ;
8585 let contractName = contractNameFlag ;
8686
87- const entities = getEntities ( manifest ) ;
88- const contractNames = getContractNames ( manifest ) ;
89- if ( contractNames . includes ( contractName ) ) {
90- this . error (
91- `Datasource or template with name ${ contractName } already exists, please choose a different name.` ,
92- { exit : 1 } ,
93- ) ;
94- }
95-
9687 let ethabi = null ;
9788 if ( abi ) {
9889 ethabi = EthereumABI . load ( contractName , abi ) ;
@@ -179,6 +170,15 @@ export default class AddCommand extends Command {
179170 }
180171 }
181172
173+ const entities = getEntities ( manifest ) ;
174+ const contractNames = getContractNames ( manifest ) ;
175+ if ( contractNames . includes ( contractName ) ) {
176+ this . error (
177+ `Datasource or template with name ${ contractName } already exists, please choose a different name.` ,
178+ { exit : 1 } ,
179+ ) ;
180+ }
181+
182182 await writeABI ( ethabi , contractName ) ;
183183
184184 const { collisionEntities, onlyCollisions, abiData } = updateEventNamesOnCollision (
You can’t perform that action at this time.
0 commit comments