atproto/services/pds/run-script.js
Matthieu Sieben 61dc0d60e1
Add linting rule to sort imports (#3220)
* Add linting rule to sort imports

* remove spacing between import groups

* changeset

* changeset

* prettier config fine tuning

* forbid use of deprecated imports

* tidy
2025-02-05 15:06:58 +01:00

27 lines
544 B
JavaScript

/* eslint-env node */
'use strict'
const {
AppContext,
envToCfg,
envToSecrets,
readEnv,
scripts,
} = require('@atproto/pds')
const main = async () => {
const env = readEnv()
const cfg = envToCfg(env)
const secrets = envToSecrets(env)
const ctx = await AppContext.fromConfig(cfg, secrets)
const scriptName = process.argv[2]
const script = scripts[scriptName ?? '']
if (!script) {
throw new Error(`could not find script: ${scriptName}`)
}
await script(ctx, process.argv.slice(3))
console.log('DONE')
}
main()