File tree 1 file changed +11
-2
lines changed
packages/build/src/extensions
1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -150,10 +150,19 @@ export const runScript = (
150
150
return run ( [ scriptPath , ...scriptArgs ] , options ) ;
151
151
} ;
152
152
153
- export const runInline = ( scriptContent : string , options : ExecaOptions = { } ) => {
153
+ export const runInline = async ( scriptContent : string , options : ExecaOptions = { } ) => {
154
154
assert ( scriptContent , "Script content is required" ) ;
155
155
156
- return run ( [ "" ] , { input : scriptContent , ...options } ) ;
156
+ // Create a temporary file with restricted permissions
157
+ const tmpFile = `/tmp/script_${ Date . now ( ) } .py` ;
158
+ await fs . promises . writeFile ( tmpFile , scriptContent , { mode : 0o600 } ) ;
159
+
160
+ try {
161
+ return await runScript ( tmpFile , [ ] , options ) ;
162
+ } finally {
163
+ // Clean up temporary file
164
+ await fs . promises . unlink ( tmpFile ) ;
165
+ }
157
166
} ;
158
167
159
168
export default { run, runScript, runInline } ;
You can’t perform that action at this time.
0 commit comments