import fs from 'fs' ; import del from 'del' ; export function cleanupTempFiles ( ) { for ( const file of fs . readdirSync ( `/tmp` ) ) { if ( file . endsWith ( '.tmp' ) === true || file . startsWith ( 'OSL_PIPE' ) ) { try { del . sync ( [ `/tmp/${ file }` , `/tmp/${ file }/*` ] , { force : true } ) ; } catch ( error ) { } } } }