mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2025-07-25 20:00:11 +02:00

[history-v1] backup-verifier-app: initial revision GitOrigin-RevId: 922c9f94cb7ca7c129e38fd6961d42bdff819cd8
21 lines
546 B
JavaScript
21 lines
546 B
JavaScript
import logger from '@overleaf/logger'
|
|
import commandLineArgs from 'command-line-args'
|
|
import { verifyBlobs } from '../lib/backupVerifier.mjs'
|
|
|
|
const { historyId, hashes } = commandLineArgs([
|
|
{ name: 'historyId', type: String },
|
|
{ name: 'hashes', type: String, multiple: true, defaultOption: true },
|
|
])
|
|
|
|
if (hashes.length === 0) {
|
|
throw new Error('missing --hashes flag')
|
|
}
|
|
|
|
try {
|
|
await verifyBlobs(historyId, hashes)
|
|
console.log('OK')
|
|
process.exit(0)
|
|
} catch (err) {
|
|
logger.err({ err }, 'failed to verify blob')
|
|
process.exit(1)
|
|
}
|