diff options
Diffstat (limited to 'commands')
-rw-r--r-- | commands/index.ts | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/commands/index.ts b/commands/index.ts new file mode 100644 index 0000000..d2ad5fb --- /dev/null +++ b/commands/index.ts | |||
@@ -0,0 +1,21 @@ | |||
1 | import { listDirectoryFiles } from '@adonisjs/core/build/standalone'; | ||
2 | import Application from '@ioc:Adonis/Core/Application'; | ||
3 | |||
4 | /* | ||
5 | |-------------------------------------------------------------------------- | ||
6 | | Exporting an array of commands | ||
7 | |-------------------------------------------------------------------------- | ||
8 | | | ||
9 | | Instead of manually exporting each file from this directory, we use the | ||
10 | | helper `listDirectoryFiles` to recursively collect and export an array | ||
11 | | of filenames. | ||
12 | | | ||
13 | | Couple of things to note: | ||
14 | | | ||
15 | | 1. The file path must be relative from the project root and not this directory. | ||
16 | | 2. We must ignore this file to avoid getting into an infinite loop | ||
17 | | | ||
18 | */ | ||
19 | export default listDirectoryFiles(__dirname, Application.appRoot, [ | ||
20 | './commands/index', | ||
21 | ]); | ||