Retry confirmed Studio 2 host cleanup after failures
This commit is contained in:
@@ -1,6 +1,11 @@
|
||||
import { resolve, relative, isAbsolute } from 'node:path'
|
||||
import { existsSync, realpathSync, statSync, unlinkSync } from 'node:fs'
|
||||
import { scopedFile } from '../shared/studio2/contracts.mjs'
|
||||
// Keep the host cleanup endpoint independently deployable from the web application.
|
||||
function scopedFile(file, prefix) {
|
||||
const path=[file.subfolder,file.filename].map(s=>String(s||'').replaceAll('\\','/')).filter(Boolean).join('/')
|
||||
const p=String(prefix||'').replaceAll('\\','/').replace(/\/$/,'')
|
||||
return !!p && !path.startsWith('/') && !path.split('/').some(s=>s==='..'||s==='.') && path.startsWith(p+'/')
|
||||
}
|
||||
|
||||
/** Exact Studio 2 files only: no folder fallback, sibling deletion, or sweeping. */
|
||||
export function purgeStudio2Files({prefix, files}, rootsForType) {
|
||||
|
||||
Reference in New Issue
Block a user