Add API to get version information (#2309)
This commit is contained in:
@@ -28,6 +28,7 @@ set(srcs
|
||||
src/spoken-language-identification.cc
|
||||
src/streaming-asr.cc
|
||||
src/vad.cc
|
||||
src/version.cc
|
||||
src/wave-reader.cc
|
||||
src/wave-writer.cc
|
||||
)
|
||||
|
||||
@@ -26,12 +26,14 @@ for (const p of possible_paths) {
|
||||
}
|
||||
|
||||
if (!found) {
|
||||
let addon_path = `${process.env.PWD}/node_modules/sherpa-onnx-${platform_arch}`;
|
||||
let addon_path =
|
||||
`${process.env.PWD}/node_modules/sherpa-onnx-${platform_arch}`;
|
||||
const pnpmIndex = __dirname.indexOf(`node_modules${path.sep}.pnpm`);
|
||||
if (pnpmIndex !== -1) {
|
||||
const parts = __dirname.slice(pnpmIndex).split(path.sep);
|
||||
parts.pop();
|
||||
addon_path = `${process.env.PWD}/${parts.join('/')}/sherpa-onnx-${platform_arch}`;
|
||||
addon_path =
|
||||
`${process.env.PWD}/${parts.join('/')}/sherpa-onnx-${platform_arch}`;
|
||||
}
|
||||
|
||||
let msg = `Could not find sherpa-onnx-node. Tried\n\n ${
|
||||
|
||||
@@ -28,4 +28,7 @@ module.exports = {
|
||||
KeywordSpotter: kws.KeywordSpotter,
|
||||
OfflineSpeakerDiarization: sd.OfflineSpeakerDiarization,
|
||||
OfflineSpeechDenoiser: speech_denoiser.OfflineSpeechDenoiser,
|
||||
version: addon.version,
|
||||
gitSha1: addon.gitSha1,
|
||||
gitDate: addon.gitDate,
|
||||
}
|
||||
|
||||
1
scripts/node-addon-api/src/version.cc
Symbolic link
1
scripts/node-addon-api/src/version.cc
Symbolic link
@@ -0,0 +1 @@
|
||||
../../../harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/cpp/version.cc
|
||||
Reference in New Issue
Block a user