mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
a7517eefcb
[web] populate db with collections on import, ahead of waitForDb() call GitOrigin-RevId: 7eb4cd61c2052187acd9947d7060f54d9822d314
28 lines
689 B
JavaScript
28 lines
689 B
JavaScript
import ProjectDetailsHandler from '../app/src/Features/Project/ProjectDetailsHandler.js'
|
|
const projectId = process.argv[2]
|
|
|
|
if (!/^(?=[a-f\d]{24}$)(\d+[a-f]|[a-f]+\d)/.test(projectId)) {
|
|
console.error('Usage: node clear_project_tokens.js projectId')
|
|
process.exit(1)
|
|
}
|
|
|
|
function main() {
|
|
ProjectDetailsHandler.clearTokens(projectId, err => {
|
|
if (err) {
|
|
console.error(
|
|
`Error clearing project tokens from project ${projectId}`,
|
|
err
|
|
)
|
|
process.exit(1)
|
|
}
|
|
console.log(`Successfully cleared project tokens from project ${projectId}`)
|
|
process.exit(0)
|
|
})
|
|
}
|
|
|
|
try {
|
|
await main()
|
|
} catch (error) {
|
|
console.error(error)
|
|
process.exit(1)
|
|
}
|