Skip to content

Commit 613904f

Browse files
committed
rename hooks, add before and after hooks and remove incorrect old hook
1 parent 9bfeedf commit 613904f

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

lib/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,13 +123,15 @@ export default new class {
123123
scripts[name] = (await import(file)).default;
124124
}
125125

126+
await hooks?.before_console_run?.();
127+
126128
if (scripts[command]) {
127129
await scripts[command].run(...process.argv.slice(4))
128130
} else {
129131
logger.error(`no script called ${command} found`);
130132
}
131133

132-
await hooks?.before_shutdown?.();
134+
await hooks?.after_console_run?.();
133135

134136
if (config.console.exit) {
135137
process.exit(0);

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "@exajs/core",
33
"type": "module",
44
"author": "Brian Seymour <@realtux>",
5-
"version": "0.0.30",
5+
"version": "0.0.31",
66
"description": "modern opinionated node.js framework",
77
"license": "MIT",
88
"homepage": "https://github.com/realtux/exa",

var/template/config/hooks.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,13 @@ export default new class {
1010

1111
}
1212

13-
// runs before a console command terminates
14-
async before_shutdown() {
13+
// runs before a console command starts
14+
async before_console_run() {
15+
16+
}
17+
18+
// runs after a console command terminates
19+
async after_console_run() {
1520

1621
}
1722

0 commit comments

Comments
 (0)