File tree 2 files changed +4
-7
lines changed
2 files changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -2,10 +2,6 @@ import { globby } from "globby";
2
2
import { dirname , join } from "path" ;
3
3
import { copyFile , mkdir } from "fs/promises" ;
4
4
5
- const source = "./src/media" ;
6
- const target = "./assets/media" ;
7
- const patterns = [ '**/*' ] ;
8
-
9
5
const toShortTime = timespan => {
10
6
if ( timespan > 1000 ) {
11
7
return ( timespan / 1000 ) . toFixed ( 3 )
@@ -14,7 +10,7 @@ const toShortTime = timespan => {
14
10
return timespan + "ms" ;
15
11
} ;
16
12
17
- const performCopy = async ( ) => {
13
+ const performCopy = async ( source , target , patterns ) => {
18
14
const started = Date . now ( ) ;
19
15
try {
20
16
console . log ( `copying "${ source } " to "${ target } "...` ) ;
@@ -30,4 +26,5 @@ const performCopy = async() => {
30
26
}
31
27
} ;
32
28
33
- await performCopy ( ) ;
29
+ await performCopy ( "./src/media" , "./assets/media" , [ '**/*' ] ) ;
30
+ await performCopy ( "./src/admin" , "./assets/admin" , [ '**/*' ] ) ;
Original file line number Diff line number Diff line change 19
19
"build" : " wp-scripts build --output-path=assets && npm run copy" ,
20
20
"start" : " wp-scripts start --output-path=assets" ,
21
21
"develop" : " wp-scripts start --no-watch --output-path=assets && npm run copy" ,
22
- "copy" : " node copy-media .mjs" ,
22
+ "copy" : " node copy-assets .mjs" ,
23
23
"i18n" : " node make-pot.mjs" ,
24
24
"composer:install" : " composer install --prefer-dist --optimize-autoloader --no-dev" ,
25
25
"composer:update" : " composer update --optimize-autoloader" ,
You can’t perform that action at this time.
0 commit comments