@@ -77,14 +77,10 @@ const checkReconfiguration = async () => {
77
77
}
78
78
} ;
79
79
80
- const passThroughPandoc = async (
81
- args : string [ ] ,
82
- env ?: Record < string , string > ,
83
- ) => {
80
+ const passThroughPandoc = async ( args : string [ ] ) => {
84
81
const result = await execProcess (
85
82
{
86
83
cmd : [ pandocBinaryPath ( ) , ...args . slice ( 1 ) ] ,
87
- env,
88
84
} ,
89
85
undefined ,
90
86
undefined ,
@@ -94,10 +90,7 @@ const passThroughPandoc = async (
94
90
Deno . exit ( result . code ) ;
95
91
} ;
96
92
97
- const passThroughTypst = async (
98
- args : string [ ] ,
99
- env ?: Record < string , string > ,
100
- ) => {
93
+ const passThroughTypst = async ( args : string [ ] ) => {
101
94
if ( args [ 1 ] === "update" ) {
102
95
error (
103
96
"The 'typst update' command is not supported.\n" +
@@ -107,28 +100,26 @@ const passThroughTypst = async (
107
100
}
108
101
const result = await execProcess ( {
109
102
cmd : [ typstBinaryPath ( ) , ...args . slice ( 1 ) ] ,
110
- env,
111
103
} ) ;
112
104
Deno . exit ( result . code ) ;
113
105
} ;
114
106
115
107
export async function quarto (
116
108
args : string [ ] ,
117
109
cmdHandler ?: ( command : Command ) => Command ,
118
- env ?: Record < string , string > ,
119
110
) {
120
111
await checkReconfiguration ( ) ;
121
112
checkVersionRequirement ( ) ;
122
113
if ( args [ 0 ] === "pandoc" && args [ 1 ] !== "help" ) {
123
- await passThroughPandoc ( args , env ) ;
114
+ await passThroughPandoc ( args ) ;
124
115
}
125
116
if ( args [ 0 ] === "typst" ) {
126
- await passThroughTypst ( args , env ) ;
117
+ await passThroughTypst ( args ) ;
127
118
}
128
119
129
120
// passthrough to run handlers
130
121
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 ) ) ;
132
123
Deno . exit ( result . code ) ;
133
124
}
134
125
@@ -153,13 +144,6 @@ export async function quarto(
153
144
154
145
debug ( "Quarto version: " + quartoConfig . version ( ) ) ;
155
146
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
-
163
147
const quartoCommand = new Command ( )
164
148
. name ( "quarto" )
165
149
. help ( { colors : false } )
@@ -189,13 +173,6 @@ export async function quarto(
189
173
190
174
try {
191
175
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
- }
199
176
if ( commandFailed ( ) ) {
200
177
exitWithCleanup ( 1 ) ;
201
178
}
0 commit comments