Skip to content

Commit 07b2a66

Browse files
committed
res_path for non-mac platforms
1 parent b14fb75 commit 07b2a66

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

.github/workflows/test.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,11 @@ on:
66
paths-ignore:
77
- '**/README.md'
88
- 'libnode/**'
9-
- 'nodejs-embedded/**'
109
pull_request:
1110
branches: [ master ]
1211
paths-ignore:
1312
- '**/README.md'
1413
- 'libnode/**'
15-
- 'nodejs-embedded/**'
1614
env:
1715
CARGO_TERM_COLOR: always
1816

nodejs-embedded/src/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ unsafe extern "C" fn node_start(napi_reg_func: *mut c_void) -> i32 {
2626

2727
pub unsafe fn main() -> i32 {
2828
let exec_dir = std::env::current_exe().unwrap().parent().unwrap().to_path_buf();
29-
let res_path = if cfg!(target_os = "macos") {
30-
macos_res_path()
31-
} else {
32-
exec_dir.clone()
33-
};
29+
30+
#[cfg(target_os = "macos")]
31+
let res_path = macos_res_path();
32+
#[cfg(not(target_os = "macos"))]
33+
let res_path = exec_dir.clone();
3434

3535
let embedder_path_file = res_path.join("nodejs_embedder");
3636
let dylib_path = std::fs::read_to_string(embedder_path_file).unwrap();

0 commit comments

Comments
 (0)