Skip to content

Commit 441c1a6

Browse files
author
hirsch88
committed
Improve nps
1 parent 06d2415 commit 441c1a6

File tree

4 files changed

+241
-106
lines changed

4 files changed

+241
-106
lines changed
File renamed without changes.

src/lib/ormconfig.ts renamed to commands/ormconfig.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ import * as dotenv from 'dotenv';
22
dotenv.config();
33

44
import * as path from 'path';
5+
import * as Chalk from 'chalk';
56
import * as jsonfile from 'jsonfile';
6-
import { env } from '../core/env';
7+
import { env } from '../src/core/env';
78

89

910
const content = {
@@ -23,8 +24,13 @@ const content = {
2324
const filePath = path.join(process.cwd(), 'ormconfig.json');
2425
jsonfile.writeFile(filePath, content, { spaces: 2 }, (err) => {
2526
if (err === null) {
26-
console.log('Successfully generated ormconfig.json form the .env file');
27+
const chalk = Chalk.default;
28+
console.log('👍 ',
29+
chalk.gray.underline('generated:'),
30+
chalk.blue.bold('ormconfig.json')
31+
);
2732
} else {
2833
console.error('Failed to generate the ormconfig.json', err);
34+
process.exit(1);
2935
}
3036
});

src/lib/tsconfig.ts renamed to commands/tsconfig.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import * as path from 'path';
2+
import * as Chalk from 'chalk';
23
import * as jsonfile from 'jsonfile';
3-
import * as tsconfig from '../../tsconfig.json';
4+
import * as tsconfig from '../tsconfig.json';
45

56

67
const content: any = tsconfig;
@@ -11,8 +12,13 @@ content.include = [
1112
const filePath = path.join(process.cwd(), 'tsconfig.build.json');
1213
jsonfile.writeFile(filePath, content, { spaces: 2 }, (err) => {
1314
if (err === null) {
14-
console.log('Successfully generated tsconfig.build.json form the .env file');
15+
const chalk = Chalk.default;
16+
console.log('👍 ',
17+
chalk.gray.underline('generated:'),
18+
chalk.blue.bold('tsconfig.build.json')
19+
);
1520
} else {
1621
console.error('Failed to generate the otsconfig.build.json', err);
22+
process.exit(1);
1723
}
1824
});

0 commit comments

Comments
 (0)