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 @@ -827,7 +827,9 @@ export class SolidityBuildSystemImplementation implements SolidityBuildSystem {
827827 const parsed = parseRootPath ( rootFilePath ) ;
828828 return isNpmParsedRootPath ( parsed )
829829 ? parsed . npmPath
830- : path . relative ( this . #options. projectRoot , parsed . fsPath ) ;
830+ : toForwardSlash (
831+ path . relative ( this . #options. projectRoot , parsed . fsPath ) ,
832+ ) ;
831833 } ) ;
832834
833835 const userSourceNamesSet = new Set ( userSourceNames ) ;
@@ -836,7 +838,9 @@ export class SolidityBuildSystemImplementation implements SolidityBuildSystem {
836838 artifactsDirectory ,
837839 ( d ) => d . endsWith ( ".sol" ) ,
838840 ) ) {
839- const relativePath = path . relative ( artifactsDirectory , file ) ;
841+ const relativePath = toForwardSlash (
842+ path . relative ( artifactsDirectory , file ) ,
843+ ) ;
840844
841845 if ( ! userSourceNamesSet . has ( relativePath ) ) {
842846 await remove ( file ) ;
@@ -1126,3 +1130,7 @@ export class SolidityBuildSystemImplementation implements SolidityBuildSystem {
11261130 }
11271131 }
11281132}
1133+
1134+ function toForwardSlash ( str : string ) : string {
1135+ return str . split ( / [ \\ \/ ] / ) . join ( path . posix . sep ) ;
1136+ }
You can’t perform that action at this time.
0 commit comments