mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 14:13:43 +01:00
Merge pull request #21097 from overleaf/ls-scripts-to-esm-1
Migrate scripts folder to esm 1/x GitOrigin-RevId: 4a4bc9a161f144fdb40ce3f2a0a9313b36c6df81
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
import minimist from 'minimist'
|
||||
import { waitForDb } from '../app/src/infrastructure/mongodb.js'
|
||||
import ProjectDeleter from '../app/src/Features/Project/ProjectDeleter.js'
|
||||
|
||||
async function main() {
|
||||
const argv = minimist(process.argv.slice(2))
|
||||
const projectId = argv['project-id']
|
||||
|
||||
if (!projectId) {
|
||||
throw new Error('set --project-id')
|
||||
}
|
||||
console.log(`Soft deleting project ${projectId}`)
|
||||
await waitForDb()
|
||||
|
||||
// soft delete, project will be permanently deleted after 90 days
|
||||
await ProjectDeleter.promises.deleteProject(projectId)
|
||||
}
|
||||
|
||||
try {
|
||||
await main()
|
||||
console.log('Done.')
|
||||
process.exit(0)
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
process.exit(1)
|
||||
}
|
||||
Reference in New Issue
Block a user