@@ -77,14 +77,10 @@ const checkReconfiguration = async () => {
7777 }
7878} ;
7979
80- const passThroughPandoc = async (
81- args : string [ ] ,
82- env ?: Record < string , string > ,
83- ) => {
80+ const passThroughPandoc = async ( args : string [ ] ) => {
8481 const result = await execProcess (
8582 {
8683 cmd : [ pandocBinaryPath ( ) , ...args . slice ( 1 ) ] ,
87- env,
8884 } ,
8985 undefined ,
9086 undefined ,
@@ -94,10 +90,7 @@ const passThroughPandoc = async (
9490 Deno . exit ( result . code ) ;
9591} ;
9692
97- const passThroughTypst = async (
98- args : string [ ] ,
99- env ?: Record < string , string > ,
100- ) => {
93+ const passThroughTypst = async ( args : string [ ] ) => {
10194 if ( args [ 1 ] === "update" ) {
10295 error (
10396 "The 'typst update' command is not supported.\n" +
@@ -107,28 +100,26 @@ const passThroughTypst = async (
107100 }
108101 const result = await execProcess ( {
109102 cmd : [ typstBinaryPath ( ) , ...args . slice ( 1 ) ] ,
110- env,
111103 } ) ;
112104 Deno . exit ( result . code ) ;
113105} ;
114106
115107export async function quarto (
116108 args : string [ ] ,
117109 cmdHandler ?: ( command : Command ) => Command ,
118- env ?: Record < string , string > ,
119110) {
120111 await checkReconfiguration ( ) ;
121112 checkVersionRequirement ( ) ;
122113 if ( args [ 0 ] === "pandoc" && args [ 1 ] !== "help" ) {
123- await passThroughPandoc ( args , env ) ;
114+ await passThroughPandoc ( args ) ;
124115 }
125116 if ( args [ 0 ] === "typst" ) {
126- await passThroughTypst ( args , env ) ;
117+ await passThroughTypst ( args ) ;
127118 }
128119
129120 // passthrough to run handlers
130121 if ( args [ 0 ] === "run" && args [ 1 ] !== "help" && args [ 1 ] !== "--help" ) {
131- const result = await runScript ( args . slice ( 1 ) , env ) ;
122+ const result = await runScript ( args . slice ( 1 ) ) ;
132123 Deno . exit ( result . code ) ;
133124 }
134125
@@ -153,13 +144,6 @@ export async function quarto(
153144
154145 debug ( "Quarto version: " + quartoConfig . version ( ) ) ;
155146
156- const oldEnv : Record < string , string | undefined > = { } ;
157- for ( const [ key , value ] of Object . entries ( env || { } ) ) {
158- const oldV = Deno . env . get ( key ) ;
159- oldEnv [ key ] = oldV ;
160- Deno . env . set ( key , value ) ;
161- }
162-
163147 const quartoCommand = new Command ( )
164148 . name ( "quarto" )
165149 . help ( { colors : false } )
@@ -189,13 +173,6 @@ export async function quarto(
189173
190174 try {
191175 await promise ;
192- for ( const [ key , value ] of Object . entries ( oldEnv ) ) {
193- if ( value === undefined ) {
194- Deno . env . delete ( key ) ;
195- } else {
196- Deno . env . set ( key , value ) ;
197- }
198- }
199176 if ( commandFailed ( ) ) {
200177 exitWithCleanup ( 1 ) ;
201178 }
0 commit comments