File tree Expand file tree Collapse file tree 5 files changed +10
-5
lines changed Expand file tree Collapse file tree 5 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,8 @@ import path from "path";
14
14
import fs from "fs" ;
15
15
import { URL } from 'url' ;
16
16
17
- const __dirname = new URL ( '.' , import . meta. url ) . pathname ;
17
+ const pathname = new URL ( '.' , import . meta. url ) . pathname ;
18
+ const __dirname = process . platform !== 'win32' ? pathname : pathname . substring ( 1 )
18
19
19
20
const headers = options => ( tree , file ) => {
20
21
const headers = [ ] ;
Original file line number Diff line number Diff line change @@ -4,7 +4,8 @@ import path from "path";
4
4
import fs from "fs" ;
5
5
import { URL } from 'url' ;
6
6
7
- const __dirname = new URL ( '.' , import . meta. url ) . pathname ;
7
+ const pathname = new URL ( '.' , import . meta. url ) . pathname ;
8
+ const __dirname = process . platform !== 'win32' ? pathname : pathname . substring ( 1 )
8
9
9
10
const processFile = filepath => {
10
11
const raw = fs . readFileSync ( filepath , "utf8" ) ;
Original file line number Diff line number Diff line change @@ -12,7 +12,8 @@ import path from "path";
12
12
import fs from "fs" ;
13
13
import { URL } from 'url' ;
14
14
15
- const __dirname = new URL ( '.' , import . meta. url ) . pathname ;
15
+ const pathname = new URL ( '.' , import . meta. url ) . pathname ;
16
+ const __dirname = process . platform !== 'win32' ? pathname : pathname . substring ( 1 )
16
17
17
18
// orderArr: ["introduction", "overview",,...]
18
19
const orderFiles = ( filepaths , orderArr ) => {
Original file line number Diff line number Diff line change @@ -4,7 +4,8 @@ import child_process from "child_process";
4
4
import path from "path" ;
5
5
import { URL } from 'url' ;
6
6
7
- const __dirname = new URL ( '.' , import . meta. url ) . pathname ;
7
+ const pathname = new URL ( '.' , import . meta. url ) . pathname ;
8
+ const __dirname = process . platform !== 'win32' ? pathname : pathname . substring ( 1 )
8
9
9
10
let tempFileName = path . join ( __dirname , '..' , '_tempFile.res' )
10
11
let tempFileNameRegex = / _ t e m p F i l e \. r e s / g
Original file line number Diff line number Diff line change @@ -16,7 +16,8 @@ import urlModule from "url";
16
16
import { URL } from 'url' ;
17
17
import { getAllPosts , blogPathToSlug } from '../src/common/BlogApi.mjs'
18
18
19
- const __dirname = new URL ( '.' , import . meta. url ) . pathname ;
19
+ const pathname = new URL ( '.' , import . meta. url ) . pathname ;
20
+ const __dirname = process . platform !== 'win32' ? pathname : pathname . substring ( 1 )
20
21
21
22
const mapBlogFilePath = path => {
22
23
const match = path . match ( / \. \/ _ b l o g p o s t s \/ ( .* \. m d x ) / ) ;
You can’t perform that action at this time.
0 commit comments