mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 14:13:43 +01:00
Merge pull request #24790 from overleaf/ls-use-script-runner
Update some scripts to use Script Runner GitOrigin-RevId: aaa11f94dcfd328c158bb02d1b9fb2adfb1bb146
This commit is contained in:
@@ -3,6 +3,7 @@ import {
|
||||
READ_PREFERENCE_SECONDARY,
|
||||
} from '../../app/src/infrastructure/mongodb.js'
|
||||
import { hashSecret } from '../../modules/oauth2-server/app/src/SecretsHelper.js'
|
||||
import { scriptRunner } from '../lib/ScriptRunner.mjs'
|
||||
|
||||
async function main() {
|
||||
console.log('Hashing client secrets...')
|
||||
@@ -35,7 +36,7 @@ async function hashSecrets(collection, field) {
|
||||
}
|
||||
|
||||
try {
|
||||
await main()
|
||||
await scriptRunner(main)
|
||||
process.exit(0)
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import minimist from 'minimist'
|
||||
import { db } from '../../app/src/infrastructure/mongodb.js'
|
||||
import { hashSecret } from '../../modules/oauth2-server/app/src/SecretsHelper.js'
|
||||
import { scriptRunner } from '../lib/ScriptRunner.mjs'
|
||||
|
||||
async function main() {
|
||||
const opts = parseArgs()
|
||||
@@ -88,7 +89,7 @@ Options:
|
||||
}
|
||||
|
||||
try {
|
||||
await main()
|
||||
await scriptRunner(main)
|
||||
process.exit(0)
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
|
||||
@@ -2,6 +2,7 @@ import minimist from 'minimist'
|
||||
import mongodb from 'mongodb-legacy'
|
||||
import { db } from '../../app/src/infrastructure/mongodb.js'
|
||||
import { hashSecret } from '../../modules/oauth2-server/app/src/SecretsHelper.js'
|
||||
import { scriptRunner } from '../lib/ScriptRunner.mjs'
|
||||
|
||||
const { ObjectId } = mongodb
|
||||
|
||||
@@ -142,7 +143,7 @@ function toArray(value) {
|
||||
}
|
||||
|
||||
try {
|
||||
await main()
|
||||
await scriptRunner(main)
|
||||
process.exit(0)
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
|
||||
@@ -3,6 +3,7 @@ import {
|
||||
db,
|
||||
READ_PREFERENCE_SECONDARY,
|
||||
} from '../../app/src/infrastructure/mongodb.js'
|
||||
import { scriptRunner } from '../lib/ScriptRunner.mjs'
|
||||
|
||||
async function main() {
|
||||
const opts = parseArgs()
|
||||
@@ -113,7 +114,7 @@ Options:
|
||||
}
|
||||
|
||||
try {
|
||||
await main()
|
||||
await scriptRunner(main)
|
||||
process.exit(0)
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
|
||||
Reference in New Issue
Block a user