Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
xuning
/
sherpaonnx
转到一个项目
Toggle navigation
项目
群组
代码片段
帮助
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Fangjun Kuang
2024-05-23 19:52:19 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Committed by
GitHub
2024-05-23 19:52:19 +0800
Commit
e7b7348102f7a0a182a58ec8e389387cdb6e9f81
e7b73481
1 parent
2db77758
fix detecting node-addon packages (#908)
隐藏空白字符变更
内嵌
并排对比
正在显示
4 个修改的文件
包含
11 行增加
和
9 行删除
.github/scripts/node-addon/run.sh
.github/workflows/npm-addon.yaml
nodejs-addon-examples/package.json
scripts/node-addon-api/lib/addon.js
.github/scripts/node-addon/run.sh
查看文件 @
e7b7348
...
...
@@ -18,7 +18,7 @@ fi
SHERPA_ONNX_VERSION
=
$(
grep
"SHERPA_ONNX_VERSION"
./CMakeLists.txt | cut -d
" "
-f 2 | cut -d
'"'
-f 2
)
echo
"SHERPA_ONNX_VERSION
$SHERPA_ONNX_VERSION
"
# SHERPA_ONNX_VERSION=1.0.2
4
# SHERPA_ONNX_VERSION=1.0.2
5
if
[
-z
$owner
]
;
then
owner
=
k2-fsa
...
...
.github/workflows/npm-addon.yaml
查看文件 @
e7b7348
...
...
@@ -55,7 +55,7 @@ jobs:
SHERPA_ONNX_VERSION=$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2)
echo "SHERPA_ONNX_VERSION $SHERPA_ONNX_VERSION"
# SHERPA_ONNX_VERSION=1.0.2
4
# SHERPA_ONNX_VERSION=1.0.2
5
src_dir=.github/scripts/node-addon
sed -i.bak s/SHERPA_ONNX_VERSION/$SHERPA_ONNX_VERSION/g $src_dir/package.json
...
...
nodejs-addon-examples/package.json
查看文件 @
e7b7348
{
"dependencies"
:
{
"sherpa-onnx-node"
:
"^1.0.2
4
"
"sherpa-onnx-node"
:
"^1.0.2
5
"
}
}
...
...
scripts/node-addon-api/lib/addon.js
查看文件 @
e7b7348
...
...
@@ -27,9 +27,10 @@ for (const p of possible_paths) {
if
(
!
found
)
{
let
msg
=
`
Could
not
find
sherpa
-
onnx
-
node
.
Tried
\
n
\
n
$
{
possible_paths
.
join
(
'\n '
)}
\
n
`
if
(
os
.
platform
()
==
'darwin'
&&
process
.
env
.
DYLD_LIBRARY_PATH
&&
!
process
.
env
.
DYLD_LIBRARY_PATH
.
includes
(
`
node_modules
/
sherpa
-
onnx
-
$
{
platform_arch
}
`
))
{
if
(
os
.
platform
()
==
'darwin'
&&
(
!
process
.
env
.
DYLD_LIBRARY_PATH
||
!
process
.
env
.
DYLD_LIBRARY_PATH
.
includes
(
`
node_modules
/
sherpa
-
onnx
-
$
{
platform_arch
}
`
)))
{
msg
+=
'Please remeber to set the following environment variable and try again:\n'
;
...
...
@@ -39,9 +40,10 @@ if (!found) {
msg
+=
':$DYLD_LIBRARY_PATH\n'
;
}
if
(
os
.
platform
()
==
'linux'
&&
process
.
env
.
LD_LIBRARY_PATH
&&
!
process
.
env
.
LD_LIBRARY_PATH
.
includes
(
`
node_modules
/
sherpa
-
onnx
-
$
{
platform_arch
}
`
))
{
if
(
os
.
platform
()
==
'linux'
&&
(
!
process
.
env
.
LD_LIBRARY_PATH
||
!
process
.
env
.
LD_LIBRARY_PATH
.
includes
(
`
node_modules
/
sherpa
-
onnx
-
$
{
platform_arch
}
`
)))
{
msg
+=
'Please remeber to set the following environment variable and try again:\n'
;
...
...
请
注册
或
登录
后发表评论