Skip to content

Commit e784e1c

Browse files
author
hirsch88
committed
Move console logic to the /lib folder
1 parent 32a66a3 commit e784e1c

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
"db:migrate:rollback": "npm run banner rollback && npm run ts-node:fast -- ./node_modules/.bin/knex migrate:rollback",
2424
"db:seed": "npm run banner seed && npm run ts-node:fast -- ./node_modules/.bin/knex seed:run",
2525
"db:reset": "npm run console db:reset",
26-
"console": "npm run ts-node:fast -- ./src/console/commander.ts",
27-
"console:dev": "npm run ts-node -- ./src/console/commander.ts",
28-
"console:help": "npm run ts-node:fast -- ./src/console/commander.ts --help",
26+
"console": "npm run ts-node:fast -- ./src/console/lib/commander.ts",
27+
"console:dev": "npm run ts-node -- ./src/console/lib/commander.ts",
28+
"console:help": "npm run ts-node:fast -- ./src/console/lib/commander.ts --help",
2929
"setup": "npm run banner setup && yarn install && npm run db:migrate && npm run db:seed",
3030
"serve": "npm run banner serve && ./node_modules/.bin/nodemon --watch 'src/**/*.ts' --watch 'src/**/*.json' --watch '.env'",
3131
"clean": "npm run banner clean && npm run clean:dist",
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ import { config } from 'dotenv';
2121
config();
2222

2323
// Configures the logger
24-
import { LoggerConfig } from '../config/LoggerConfig';
24+
import { LoggerConfig } from '../../config/LoggerConfig';
2525
new LoggerConfig().configure();
2626

2727
figlet('console', (error: any, data: any) => {
2828
console.log(chalk.blue(data));
2929

3030
// Find all command files
31-
glob(path.join(__dirname, '**/*Command.ts'), (err: any, matches: string[]) => {
31+
glob(path.join(__dirname, '../**/*Command.ts'), (err: any, matches: string[]) => {
3232
if (err) {
3333
console.log(err);
3434
return;
@@ -38,7 +38,7 @@ figlet('console', (error: any, data: any) => {
3838
.filter(m => m.indexOf('/lib') < 0)
3939
.map(m => ({
4040
path: m,
41-
name: m.replace(__dirname, '').replace('.ts', '').substring(1)
41+
name: m.replace(__dirname.replace('/lib', ''), '').replace('.ts', '').substring(1)
4242
}));
4343

4444
const commands = files.map(f => require(f.path)[f.name]);

0 commit comments

Comments
 (0)