File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
packages/build/src/extensions Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -150,10 +150,19 @@ export const runScript = (
150150 return run ( [ scriptPath , ...scriptArgs ] , options ) ;
151151} ;
152152
153- export const runInline = ( scriptContent : string , options : ExecaOptions = { } ) => {
153+ export const runInline = async ( scriptContent : string , options : ExecaOptions = { } ) => {
154154 assert ( scriptContent , "Script content is required" ) ;
155155
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+ }
157166} ;
158167
159168export default { run, runScript, runInline } ;
You can’t perform that action at this time.
0 commit comments