File tree Expand file tree Collapse file tree 3 files changed +15
-13
lines changed
Expand file tree Collapse file tree 3 files changed +15
-13
lines changed Original file line number Diff line number Diff line change 1- import fs from 'fs'
1+ import fs from 'fs' ;
22import pkg from '../package.json' assert { type : 'json ' } ;
3- var read = fs . readFileSync
4- var write = fs . writeFileSync
5- var version = process . env . VERSION || pkg . version
3+ var read = fs . readFileSync ;
4+ var write = fs . writeFileSync ;
5+ var version = process . env . VERSION || pkg . version ;
66
7- var file = __dirname + '/../docs/_coverpage.md'
8- var cover = read ( file , 'utf8' ) . toString ( )
7+ const relative = path => new URL ( path , import . meta. url ) ;
8+ var file = relative ( '../docs/_coverpage.md' ) ;
9+ var cover = read ( file , 'utf8' ) . toString ( ) ;
910
10- console . log ( 'Replace version number in cover page...' )
11+ console . log ( 'Replace version number in cover page...' ) ;
1112cover = cover . replace (
1213 / < s m a l l > ( \S + ) ? < \/ s m a l l > / g,
1314 '<small>' + version + '</small>'
14- )
15- write ( file , cover )
15+ ) ;
16+ write ( file , cover ) ;
Original file line number Diff line number Diff line change @@ -2,8 +2,9 @@ import fs from 'fs'
22import path from 'path'
33import { spawn } from 'child_process'
44
5+ const relative = path => new URL ( path , import . meta. url ) ;
56const args = process . argv . slice ( 2 )
6- fs . readdir ( path . join ( __dirname , '../src/themes' ) , ( err , files ) => {
7+ fs . readdir ( relative ( '../src/themes' ) , ( err , files ) => {
78 if ( err ) {
89 console . error ( 'err' , err )
910 process . exit ( 1 )
Original file line number Diff line number Diff line change 1- import { process as cssnano } from 'cssnano'
1+ import cssnano from 'cssnano' ;
22import path from 'path'
33import fs from 'fs'
44
5- files = fs . readdirSync ( path . resolve ( 'lib/themes' ) )
5+ const files = fs . readdirSync ( path . resolve ( 'lib/themes' ) )
66
77files . forEach ( file => {
88 file = path . resolve ( 'lib/themes' , file )
9- cssnano ( fs . readFileSync ( file ) ) . then ( result => {
9+ cssnano . process ( fs . readFileSync ( file ) ) . then ( result => {
1010 fs . writeFileSync ( file , result . css )
1111 } ) . catch ( e => {
1212 console . error ( e )
You can’t perform that action at this time.
0 commit comments