in src/commands/bulk/rights.ts [99:125]
async run() {
const http = this.http
if (!http) {
this.log('No http, no anything.')
return false
}
const { args } = await this.parse(BulkRights)
const failures = createWriteStream(args.failures)
const output = createWriteStream(args.output)
const file = args.input
const newRights =
args.rights in BulkRights.rights &&
BulkRights.rights[args.rights as keyof typeof BulkRights.rights]
const updateMessage = JSON.stringify({ data: newRights })
this.log(`Reading ${file}, updating images found to ${args.rights}`)
for await (const id of lines(file)) {
await this.updateImage(id, updateMessage, output, failures)
}
}