Skip to content

Commit ec242fc

Browse files
committed
Fix console and knex commands
1 parent ffb586f commit ec242fc

File tree

4 files changed

+7
-9
lines changed

4 files changed

+7
-9
lines changed
File renamed without changes.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
"copy:assets": "npm run copy:swagger && npm run copy:public",
2020
"copy:swagger": "./node_modules/.bin/copyup ./src/api/swagger.json ./dist",
2121
"copy:public": "./node_modules/.bin/copyup ./src/public/* ./dist",
22-
"db:migrate": "npm run banner migrate && npm run ts-node:fast -- ./node_modules/.bin/knex migrate:latest",
23-
"db:migrate:rollback": "npm run banner rollback && npm run ts-node:fast -- ./node_modules/.bin/knex migrate:rollback",
24-
"db:seed": "npm run banner seed && npm run ts-node:fast -- ./node_modules/.bin/knex seed:run",
22+
"db:migrate": "npm run banner migrate && \"./node_modules/.bin/knex\" migrate:latest",
23+
"db:migrate:rollback": "npm run banner rollback && \"./node_modules/.bin/knex\" migrate:rollback",
24+
"db:seed": "npm run banner seed && \"./node_modules/.bin/knex\" seed:run",
2525
"db:reset": "npm run console db:reset",
2626
"console": "npm run ts-node:fast -- ./src/console/commander.ts",
2727
"console:dev": "npm run ts-node -- ./src/console/commander.ts",

src/console/commander.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import * as path from 'path';
1515
import * as commander from 'commander';
1616
import * as figlet from 'figlet';
1717
import * as chalk from 'chalk';
18+
import { isWindows } from './../core/helpers/Path';
1819

1920
// It also loads the .env file into the 'process.env' variable.
2021
import { config } from 'dotenv';
@@ -35,11 +36,12 @@ figlet('console', (error: any, data: any) => {
3536
console.log(err);
3637
return;
3738
}
39+
3840
const files = matches
39-
.filter(m => m.indexOf('/lib') < 0)
41+
.filter(m => m.search(/\/lib/g) <= 0)
4042
.map(m => ({
4143
path: m,
42-
name: m.replace(__dirname, '').replace('.ts', '').substring(1)
44+
name: m.replace((isWindows() ? __dirname.replace(/\\/g, '/') : __dirname), '').replace('.ts', '').substring(1)
4345
}));
4446

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

src/types/knexfile.d.ts

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)