Skip to content

Commit

Permalink
fix: linux x64 lib location
Browse files Browse the repository at this point in the history
  • Loading branch information
wobsoriano committed Jul 24, 2022
1 parent 20caeee commit e5fabd8
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/ffi.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
import { dlopen, FFIType, ptr, suffix } from 'bun:ffi'
import { encode, toString } from './utils'

const filename = `../release/promptx-${process.platform}-${process.arch}.${suffix}`
const { platform, arch } = process

let filename: string

if (platform === 'linux' && arch === 'x64') {
filename = `../release/promptx-${platform}-amd64.${suffix}`
} else {
filename = `../release/promptx-${platform}-${arch}.${suffix}`
}

const location = new URL(filename, import.meta.url).pathname
export const { symbols } = dlopen(location, {
CreateSelection: {
Expand Down

0 comments on commit e5fabd8

Please sign in to comment.