Skip to content

Commit

Permalink
fix: Load application correctly even when launched via bin
Browse files Browse the repository at this point in the history
  • Loading branch information
mKeRix committed Jan 25, 2020
1 parent 025ceb1 commit 4b948bd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion bin/room-assistant.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/usr/bin/env node
require('../src/main');
require('../dist/main');
2 changes: 2 additions & 0 deletions src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import _ from 'lodash';
import { NestEmitterModule } from 'nest-emitter';
import { EventEmitter } from 'events';

// tslint:disable-next-line:no-var-requires
export const VERSION = require('../package.json').version;
export const CONFIGURED_INTEGRATIONS = c
.get<string[]>('global.integrations')
// lodash separates numbers in the case functions - we want them to stick together, hence we remove the dashes around numbers
Expand Down
4 changes: 2 additions & 2 deletions src/integrations/home-assistant/device.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { version } from '../../../package.json';
import { VERSION } from '../../app.module';

export class Device {
constructor(identifiers: string | string[]) {
Expand All @@ -10,5 +10,5 @@ export class Device {
manufacturer: string;
model: string;
name: string;
swVersion: string = version;
swVersion: string = VERSION;
}

0 comments on commit 4b948bd

Please sign in to comment.