Skip to content

Commit 3d8a1c3

Browse files
committed
activate compiled version
1 parent 426587d commit 3d8a1c3

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

index.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,15 @@ import services from './src/modules/services';
66

77
const program = new Command();
88

9+
// Use process.cwd() instead of __dirname for compiled JS compatibility
10+
const projectDir = process.cwd();
11+
912
program
1013
.command('trade')
1114
.description('start crypto trading bot')
1215
.option('-i, --instance <file>', 'Instance to start', 'instance.json')
1316
.action(async (options: any) => {
14-
await services.boot(__dirname);
17+
await services.boot(projectDir);
1518

1619
const cmd = new TradeCommand();
1720
cmd.execute();
@@ -29,7 +32,7 @@ program
2932
throw new Error('Not all options are given');
3033
}
3134

32-
await services.boot(__dirname);
35+
await services.boot(projectDir);
3336

3437
const cmd = new BackfillCommand();
3538
await cmd.execute(options.exchange, options.symbol, options.period, options.date);

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,9 @@
8585
"url": "https://github.com/Haehnchen/crypto-trading-bot.git"
8686
},
8787
"scripts": {
88-
"start": "ts-node index.ts trade",
89-
"start:dev": "ts-node --watch index.ts trade",
88+
"start": "node dist/index.js trade",
89+
"start:dev": "ts-node index.ts trade",
90+
"start:watch": "ts-node --watch index.ts trade",
9091
"postinstall": "patch-package",
9192
"test": "mocha --require ts-node/register 'test/**/*.test.ts'",
9293
"test:js": "mocha 'test/**/*.test.js'",

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"allowJs": true,
1515
"checkJs": false
1616
},
17-
"include": ["src/**/*", "test/**/*"],
17+
"include": ["index.ts", "src/**/*", "test/**/*"],
1818
"exclude": ["node_modules", "dist"],
1919
"ts-node": {
2020
"esm": false,

0 commit comments

Comments
 (0)