ca0ca08832
* wip * first pass on script * move scrip * handle sequencing & account manager table * runner * fix while loop * script framework * build branch * add prompt * reorder script * patch script * move readline * dont build branch * tidy promise
27 lines
544 B
JavaScript
27 lines
544 B
JavaScript
/* eslint-env node */
|
|
|
|
'use strict'
|
|
const {
|
|
envToCfg,
|
|
envToSecrets,
|
|
readEnv,
|
|
AppContext,
|
|
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()
|