diff options
author | Timmy Willison <timmywil@users.noreply.github.com> | 2024-03-10 12:19:15 -0400 |
---|---|---|
committer | Timmy Willison <timmywil@users.noreply.github.com> | 2024-03-11 13:29:23 -0400 |
commit | ae7f6139cc8e21a7116e8de30d26ca38426bde0b (patch) | |
tree | 9d7c99074630664a4fd7ceb471ac77ca26287633 /build/tasks/npmcopy.js | |
parent | 822362e6efae90610d7289b46477c7fa22758141 (diff) | |
download | jquery-ae7f6139cc8e21a7116e8de30d26ca38426bde0b.tar.gz jquery-ae7f6139cc8e21a7116e8de30d26ca38426bde0b.zip |
Build: migrate more uses of fs.promises; use node: protocol
Ref gh-5440
Diffstat (limited to 'build/tasks/npmcopy.js')
-rw-r--r-- | build/tasks/npmcopy.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/build/tasks/npmcopy.js b/build/tasks/npmcopy.js index 750f26d8a..93c0658b9 100644 --- a/build/tasks/npmcopy.js +++ b/build/tasks/npmcopy.js @@ -1,7 +1,7 @@ "use strict"; -const fs = require( "fs" ); -const path = require( "path" ); +const fs = require( "node:fs/promises" ); +const path = require( "node:path" ); const projectDir = path.resolve( __dirname, "..", ".." ); @@ -26,15 +26,15 @@ const files = { }; async function npmcopy() { - await fs.promises.mkdir( path.resolve( projectDir, "external" ), { + await fs.mkdir( path.resolve( projectDir, "external" ), { recursive: true } ); for ( const [ dest, source ] of Object.entries( files ) ) { const from = path.resolve( projectDir, "node_modules", source ); const to = path.resolve( projectDir, "external", dest ); const toDir = path.dirname( to ); - await fs.promises.mkdir( toDir, { recursive: true } ); - await fs.promises.copyFile( from, to ); + await fs.mkdir( toDir, { recursive: true } ); + await fs.copyFile( from, to ); console.log( `${ source } → ${ dest }` ); } } |