Skip to content

Commit 15a9ca2

Browse files
committed
chore: wip
1 parent 9f24415 commit 15a9ca2

File tree

5 files changed

+10
-3
lines changed

5 files changed

+10
-3
lines changed

storage/framework/core/buddy/src/cli.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import { cli, log } from '@stacksjs/cli'
44
import { ensureProjectIsInitialized } from '@stacksjs/utils'
55
import { path as p } from '@stacksjs/path'
66
import { fs } from '@stacksjs/storage'
7+
import { runAction } from '@stacksjs/actions'
8+
import { Action } from '@stacksjs/enums'
79
import * as cmd from './commands'
810

911
// setup global error handlers
@@ -32,9 +34,14 @@ async function main() {
3234
log.debug('Project is initialized')
3335
}
3436
else {
35-
log.warn('Your `APP_KEY` is not yet')
36-
// TODO: add prompt to set the key
37-
process.exit(1)
37+
log.info('Your `APP_KEY` is not yet set')
38+
log.info('Generating application key...')
39+
const result = await runAction(Action.KeyGenerate)
40+
41+
if (result.isErr()) {
42+
log.error('Failed to set random application key.', result.error)
43+
process.exit()
44+
}
3845
}
3946

4047
cmd.build(buddy)

0 commit comments

Comments
 (0)