Skip to content

Commit

Permalink
fix: dirname
Browse files Browse the repository at this point in the history
  • Loading branch information
bangbang93 committed Jun 9, 2023
1 parent 5fc804b commit 81a8698
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/bootstrap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ import colors from 'colors/safe.js'
import {HTTPError} from 'got'
import ms from 'ms'
import {join} from 'path'
import {fileURLToPath} from 'url'
import {Cluster} from './cluster.js'

const __dirname = fileURLToPath(new URL('..', import.meta.url))

export async function bootstrap(version: string): Promise<void> {
console.log(colors.green(`booting openbmclapi ${version}`))
if (!process.env.CLUSTER_PORT) {
Expand Down
3 changes: 3 additions & 0 deletions src/cluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {cwd} from 'process'
import ProgressBar from 'progress'
import {connect, Socket} from 'socket.io-client'
import {Tail} from 'tail'
import {fileURLToPath} from 'url'
import {validateFile} from './file.js'
import MeasureRoute from './measure.route.js'
import {hashToFilename} from './util.js'
Expand All @@ -32,6 +33,8 @@ interface ICounters {
bytes: number
}

const __dirname = fileURLToPath(new URL('..', import.meta.url))

export class Cluster {
public readonly counters: ICounters = {hits: 0, bytes: 0}
public isEnabled = false
Expand Down

0 comments on commit 81a8698

Please sign in to comment.