Skip to content

Commit

Permalink
Merge pull request #452 from YOU54F/fix/prebuildify_path_lookup
Browse files Browse the repository at this point in the history
Fix/prebuildify path lookup
  • Loading branch information
YOU54F authored Jul 6, 2023
2 parents 39e1558 + 6bdaeb5 commit 643f075
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 3 additions & 5 deletions src/ffi/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,8 @@ const bindingsResolver = (bindingsPath: string | undefined) =>
bindings(bindingsPath);

const bindingPaths = [
path.resolve(
path.resolve(__dirname, '..', '..'),
process.env['PACT_PREBUILD_LOCATION']?.toString() ?? path.resolve()
),
path.resolve(__dirname, '..', '..'),
process.env['PACT_PREBUILD_LOCATION']?.toString() ?? path.resolve(),
];
let ffiLib: Ffi;

Expand All @@ -78,7 +76,7 @@ const renderBinaryErrorMessage = (error: unknown, bindingPath: string) => {
platform
)}\n
Wrong Path?: set the load path with PACT_PREBUILD_LOCATION ensuring that ${path.join(
'$PACT_NODE_NAPI_LOCATION',
'$PACT_PREBUILD_LOCATION',
'prebuilds',
platform
)} exists\n
Expand Down
4 changes: 3 additions & 1 deletion src/logger/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ let currentLogLevel: LogLevel = process.env['LOG_LEVEL']
: 'info';
let logger = createLogger(currentLogLevel);

export const DEFAULT_LOG_LEVEL = 'info';
export const DEFAULT_LOG_LEVEL: LogLevel = process.env['LOG_LEVEL']
? (process.env['LOG_LEVEL'] as LogLevel)
: 'info';

export const setLogLevel = (level: LogLevel = 'info'): void => {
currentLogLevel = level;
Expand Down

0 comments on commit 643f075

Please sign in to comment.