MCPcopy
hub / github.com/adonisjs/core / run

Method run

commands/generate_key.ts:52–72  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

50 declare force: boolean
51
52 async run() {
53 let writeToFile = process.env.NODE_ENV !== 'production'
54 if (this.force) {
55 writeToFile = true
56 }
57
58 if (this.show) {
59 writeToFile = false
60 }
61
62 const secureKey = string.random(32)
63
64 if (writeToFile) {
65 const editor = await EnvEditor.create(this.app.appRoot)
66 editor.add('APP_KEY', secureKey, true)
67 await editor.save()
68 this.logger.action('add APP_KEY to .env').succeeded()
69 } else {
70 this.logger.log(`APP_KEY = ${secureKey}`)
71 }
72 }
73}

Callers

nothing calls this directly

Calls 1

createMethod · 0.45

Tested by

no test coverage detected