@@ -154,14 +154,8 @@ export class Artifacts implements IArtifacts {
154
154
return cached ;
155
155
}
156
156
157
- const buildInfosDir = path . join ( this . _artifactsPath , BUILD_INFO_DIR_NAME ) ;
158
-
159
- const paths = await getAllFilesMatching (
160
- this . _artifactsPath ,
161
- ( f ) =>
162
- f . endsWith ( ".json" ) &&
163
- ! f . startsWith ( buildInfosDir ) &&
164
- ! f . endsWith ( ".dbg.json" )
157
+ const paths = await getAllFilesMatching ( this . _artifactsPath , ( f ) =>
158
+ this . _isArtifactPath ( f )
165
159
) ;
166
160
167
161
const result = paths . sort ( ) ;
@@ -563,14 +557,8 @@ export class Artifacts implements IArtifacts {
563
557
return cached ;
564
558
}
565
559
566
- const buildInfosDir = path . join ( this . _artifactsPath , BUILD_INFO_DIR_NAME ) ;
567
-
568
- const paths = getAllFilesMatchingSync (
569
- this . _artifactsPath ,
570
- ( f ) =>
571
- f . endsWith ( ".json" ) &&
572
- ! f . startsWith ( buildInfosDir ) &&
573
- ! f . endsWith ( ".dbg.json" )
560
+ const paths = getAllFilesMatchingSync ( this . _artifactsPath , ( f ) =>
561
+ this . _isArtifactPath ( f )
574
562
) ;
575
563
576
564
const result = paths . sort ( ) ;
@@ -934,6 +922,15 @@ Please replace "${contractName}" for the correct contract name wherever you are
934
922
935
923
return undefined ;
936
924
}
925
+
926
+ private _isArtifactPath ( file : string ) {
927
+ return (
928
+ file . endsWith ( ".json" ) &&
929
+ file !== path . join ( this . _artifactsPath , "package.json" ) &&
930
+ ! file . startsWith ( path . join ( this . _artifactsPath , BUILD_INFO_DIR_NAME ) ) &&
931
+ ! file . endsWith ( ".dbg.json" )
932
+ ) ;
933
+ }
937
934
}
938
935
939
936
/**
0 commit comments