File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed
v-next/hardhat/src/internal/builtin-plugins/solidity/build-system Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @nomicfoundation/hardhat-utils " : patch
3+ " hardhat " : patch
4+ ---
5+
6+ Fix npm artifact cleanup on windows ([ #7459 ] ( https://github.com/NomicFoundation/hardhat/issues/7459 ) )
Original file line number Diff line number Diff line change @@ -833,7 +833,9 @@ export class SolidityBuildSystemImplementation implements SolidityBuildSystem {
833833 const parsed = parseRootPath ( rootFilePath ) ;
834834 return isNpmParsedRootPath ( parsed )
835835 ? parsed . npmPath
836- : path . relative ( this . #options. projectRoot , parsed . fsPath ) ;
836+ : toForwardSlash (
837+ path . relative ( this . #options. projectRoot , parsed . fsPath ) ,
838+ ) ;
837839 } ) ;
838840
839841 const userSourceNamesSet = new Set ( userSourceNames ) ;
@@ -842,7 +844,9 @@ export class SolidityBuildSystemImplementation implements SolidityBuildSystem {
842844 artifactsDirectory ,
843845 ( d ) => d . endsWith ( ".sol" ) ,
844846 ) ) {
845- const relativePath = path . relative ( artifactsDirectory , file ) ;
847+ const relativePath = toForwardSlash (
848+ path . relative ( artifactsDirectory , file ) ,
849+ ) ;
846850
847851 if ( ! userSourceNamesSet . has ( relativePath ) ) {
848852 await remove ( file ) ;
@@ -1132,3 +1136,7 @@ export class SolidityBuildSystemImplementation implements SolidityBuildSystem {
11321136 }
11331137 }
11341138}
1139+
1140+ function toForwardSlash ( str : string ) : string {
1141+ return str . split ( / [ \\ \/ ] / ) . join ( path . posix . sep ) ;
1142+ }
You can’t perform that action at this time.
0 commit comments