Skip to content

Commit

Permalink
fix: linux path error
Browse files Browse the repository at this point in the history
  • Loading branch information
shijinn520 committed May 18, 2024
1 parent c7b03ba commit 1e68df3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import path from 'path'
import { fileURLToPath } from 'url'
import protobufjs from 'protobufjs'

const filePath = import.meta.url.replace(/^file:(\/\/\/|\/\/)/, '') + '../'
const absolutePath = path.resolve(filePath)
const dirname = path.dirname(absolutePath)
const proto = dirname + '/kritor/protos'
const filePath = fileURLToPath(import.meta.url)
const proto = path.dirname(filePath) + '/kritor/protos'

export { protobufjs, proto }
export * from './protos/compiled.js'
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "kritor-proto",
"version": "0.0.5",
"version": "0.0.6",
"type": "module",
"main": "index.js",
"author": "CalmLexi",
Expand Down

0 comments on commit 1e68df3

Please sign in to comment.