fix detecting node-addon packages (#908)
This commit is contained in:
2
.github/scripts/node-addon/run.sh
vendored
2
.github/scripts/node-addon/run.sh
vendored
@@ -18,7 +18,7 @@ fi
|
|||||||
SHERPA_ONNX_VERSION=$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2)
|
SHERPA_ONNX_VERSION=$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2)
|
||||||
echo "SHERPA_ONNX_VERSION $SHERPA_ONNX_VERSION"
|
echo "SHERPA_ONNX_VERSION $SHERPA_ONNX_VERSION"
|
||||||
|
|
||||||
# SHERPA_ONNX_VERSION=1.0.24
|
# SHERPA_ONNX_VERSION=1.0.25
|
||||||
|
|
||||||
if [ -z $owner ]; then
|
if [ -z $owner ]; then
|
||||||
owner=k2-fsa
|
owner=k2-fsa
|
||||||
|
|||||||
2
.github/workflows/npm-addon.yaml
vendored
2
.github/workflows/npm-addon.yaml
vendored
@@ -55,7 +55,7 @@ jobs:
|
|||||||
|
|
||||||
SHERPA_ONNX_VERSION=$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2)
|
SHERPA_ONNX_VERSION=$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2)
|
||||||
echo "SHERPA_ONNX_VERSION $SHERPA_ONNX_VERSION"
|
echo "SHERPA_ONNX_VERSION $SHERPA_ONNX_VERSION"
|
||||||
# SHERPA_ONNX_VERSION=1.0.24
|
# SHERPA_ONNX_VERSION=1.0.25
|
||||||
|
|
||||||
src_dir=.github/scripts/node-addon
|
src_dir=.github/scripts/node-addon
|
||||||
sed -i.bak s/SHERPA_ONNX_VERSION/$SHERPA_ONNX_VERSION/g $src_dir/package.json
|
sed -i.bak s/SHERPA_ONNX_VERSION/$SHERPA_ONNX_VERSION/g $src_dir/package.json
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"sherpa-onnx-node": "^1.0.24"
|
"sherpa-onnx-node": "^1.0.25"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,9 +27,10 @@ for (const p of possible_paths) {
|
|||||||
if (!found) {
|
if (!found) {
|
||||||
let msg = `Could not find sherpa-onnx-node. Tried\n\n ${
|
let msg = `Could not find sherpa-onnx-node. Tried\n\n ${
|
||||||
possible_paths.join('\n ')}\n`
|
possible_paths.join('\n ')}\n`
|
||||||
if (os.platform() == 'darwin' && process.env.DYLD_LIBRARY_PATH &&
|
if (os.platform() == 'darwin' &&
|
||||||
!process.env.DYLD_LIBRARY_PATH.includes(
|
(!process.env.DYLD_LIBRARY_PATH ||
|
||||||
`node_modules/sherpa-onnx-${platform_arch}`)) {
|
!process.env.DYLD_LIBRARY_PATH.includes(
|
||||||
|
`node_modules/sherpa-onnx-${platform_arch}`))) {
|
||||||
msg +=
|
msg +=
|
||||||
'Please remeber to set the following environment variable and try again:\n';
|
'Please remeber to set the following environment variable and try again:\n';
|
||||||
|
|
||||||
@@ -39,9 +40,10 @@ if (!found) {
|
|||||||
msg += ':$DYLD_LIBRARY_PATH\n';
|
msg += ':$DYLD_LIBRARY_PATH\n';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (os.platform() == 'linux' && process.env.LD_LIBRARY_PATH &&
|
if (os.platform() == 'linux' &&
|
||||||
!process.env.LD_LIBRARY_PATH.includes(
|
(!process.env.LD_LIBRARY_PATH ||
|
||||||
`node_modules/sherpa-onnx-${platform_arch}`)) {
|
!process.env.LD_LIBRARY_PATH.includes(
|
||||||
|
`node_modules/sherpa-onnx-${platform_arch}`))) {
|
||||||
msg +=
|
msg +=
|
||||||
'Please remeber to set the following environment variable and try again:\n';
|
'Please remeber to set the following environment variable and try again:\n';
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user