@@ -8,42 +8,39 @@ import { spawnSync } from 'node:child_process';
8
8
9
9
let __dirname = path . dirname ( new URL ( import . meta. url ) . pathname ) ;
10
10
const isWindows = process . platform === 'win32' ;
11
- if ( isWindows ) {
11
+ if ( isWindows && __dirname . startsWith ( '/' ) ) {
12
12
// in Windows __dirname starts with a / causing errors
13
13
// before
14
14
// /C:/Users/{location stuff}/qwik/packages/docs
15
+ __dirname = __dirname . substring ( 1 ) ;
16
+ // after
17
+ // C:/Users/{location stuff}/qwik/packages/docs
18
+ }
19
+ const qwikPkgDir = path . join ( __dirname , '..' , 'qwik' , 'dist' ) ;
15
20
16
- if ( __dirname . startsWith ( '/' ) ) {
17
- __dirname = __dirname . substring ( 1 ) ;
18
- // after
19
- // C:/Users/{location stuff}/qwik/packages/docs
20
- }
21
- const qwikPkgDir = path . join ( __dirname , '..' , 'qwik' , 'dist' ) ;
22
-
23
- if ( ! fs . existsSync ( path . join ( qwikPkgDir , 'core.d.ts' ) ) ) {
24
- console . warn (
25
- `\n\n=== Running 'pnpm run build.local' to generate missing imports for the docs ===\n`
26
- ) ;
27
- const out = spawnSync ( 'pnpm' , [ 'run' , 'build.local' ] , {
28
- cwd : path . join ( __dirname , '..' , '..' ) ,
29
- stdio : 'inherit' ,
30
- } ) ;
31
- if ( out . status !== 0 ) {
32
- console . error ( 'Failed to build local packages' ) ;
33
- process . exit ( 1 ) ;
34
- }
21
+ if ( ! fs . existsSync ( path . join ( qwikPkgDir , 'core.d.ts' ) ) ) {
22
+ console . warn (
23
+ `\n\n=== Running 'pnpm run build.local' to generate missing imports for the docs ===\n`
24
+ ) ;
25
+ const out = spawnSync ( 'pnpm' , [ 'run' , 'build.local' ] , {
26
+ cwd : path . join ( __dirname , '..' , '..' ) ,
27
+ stdio : 'inherit' ,
28
+ } ) ;
29
+ if ( out . status !== 0 ) {
30
+ console . error ( 'Failed to build local packages' ) ;
31
+ process . exit ( 1 ) ;
35
32
}
33
+ }
36
34
37
- if ( ! fs . existsSync ( path . join ( __dirname , 'public' , 'repl' , 'repl-sw.js' ) ) ) {
38
- console . warn (
39
- `\n\n=== Running 'pnpm run build.repl-sw' to generate missing REPL service worker public/repl/repl-sw.js ===\n`
40
- ) ;
41
- const out = spawnSync ( 'pnpm' , [ 'run' , 'build.repl-sw' ] , {
42
- stdio : 'inherit' ,
43
- } ) ;
44
- if ( out . status !== 0 ) {
45
- console . error ( 'Failed to build REPL service worker' ) ;
46
- process . exit ( 1 ) ;
47
- }
35
+ if ( ! fs . existsSync ( path . join ( __dirname , 'public' , 'repl' , 'repl-sw.js' ) ) ) {
36
+ console . warn (
37
+ `\n\n=== Running 'pnpm run build.repl-sw' to generate missing REPL service worker public/repl/repl-sw.js ===\n`
38
+ ) ;
39
+ const out = spawnSync ( 'pnpm' , [ 'run' , 'build.repl-sw' ] , {
40
+ stdio : 'inherit' ,
41
+ } ) ;
42
+ if ( out . status !== 0 ) {
43
+ console . error ( 'Failed to build REPL service worker' ) ;
44
+ process . exit ( 1 ) ;
48
45
}
49
46
}
0 commit comments