File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ import { execProcess } from "./process.ts";
99import { architectureToolsPath } from "./resources.ts" ;
1010import { TempContext } from "./temp-types.ts" ;
1111import { createTempContext } from "./temp.ts" ;
12- import { kQuartoVersion } from "../config/constants .ts" ;
12+ import { nullDevice } from "./platform .ts" ;
1313
1414type ESBuildAnalysisImport = {
1515 path : string ;
@@ -46,13 +46,20 @@ export async function esbuildAnalyze(
4646 [
4747 "--analyze=verbose" ,
4848 `--metafile=${ tempName } ` ,
49- " --outfile=/dev/null" ,
49+ ` --outfile=${ nullDevice ( ) } ` ,
5050 input ,
5151 ] ,
5252 "" ,
5353 workingDir ,
5454 ) ;
55- return JSON . parse ( Deno . readTextFileSync ( tempName ) ) as ESBuildAnalysis ;
55+ const result = JSON . parse (
56+ Deno . readTextFileSync ( tempName ) ,
57+ ) as ESBuildAnalysis ;
58+ assert ( Object . entries ( result . outputs ) . length === 1 ) ;
59+ result . outputs = {
60+ "<output>" : Object . values ( result . outputs ) [ 0 ] ,
61+ } ;
62+ return result ;
5663 } finally {
5764 if ( mustCleanup ) {
5865 tempContext . cleanup ( ) ;
Original file line number Diff line number Diff line change @@ -97,3 +97,7 @@ export function isInteractiveSession() {
9797export function isGithubAction ( ) {
9898 return Deno . env . get ( "GITHUB_ACTIONS" ) === "true" ;
9999}
100+
101+ export function nullDevice ( ) {
102+ return isWindows ? "NUL" : "/dev/null" ;
103+ }
You can’t perform that action at this time.
0 commit comments