Skip to content

Commit 3d0dd87

Browse files
committed
Pull DS version into variable.
1 parent 728e8a4 commit 3d0dd87

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

package.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/bin/bash -e
22

3+
_DS_VERSION="0.8.0"
4+
35
rm -rf node_modules
46

57
if [ -z "${ADDON_ARCH}" ]; then
@@ -48,15 +50,15 @@ case "$ADDON_ARCH" in
4850
esac
4951

5052
curl \
51-
-L "https://github.com/mozilla/DeepSpeech/releases/download/v0.8.0/${_SCORER_TARBALL}" | \
53+
-L "https://github.com/mozilla/DeepSpeech/releases/download/v${_DS_VERSION}/${_SCORER_TARBALL}" | \
5254
tar xJ generate_scorer_package
5355
popd
5456

5557
# download the DeepSpeech model
5658
pushd "${here}/assets"
5759
curl \
5860
-o "deepspeech-model.tflite" \
59-
-L "https://github.com/mozilla/DeepSpeech/releases/download/v0.8.0/deepspeech-0.8.0-models.tflite"
61+
-L "https://github.com/mozilla/DeepSpeech/releases/download/v${_DS_VERSION}/deepspeech-${_DS_VERSION}-models.tflite"
6062
popd
6163

6264
# remove one of the DS dependencies, based on architecture
@@ -80,12 +82,12 @@ npm install --production
8082

8183
# keep only the compiled DS binary that we need
8284
module_version=$(node -e 'console.log(`node-v${process.config.variables.node_module_version}`)')
83-
find "node_modules/${KEEP_DEP}/lib/binding/v0.8.0" \
85+
find "node_modules/${KEEP_DEP}/lib/binding/v${_DS_VERSION}" \
8486
-mindepth 1 \
8587
-maxdepth 1 \
8688
\! -name "${ADDON_ARCH}" \
8789
-exec rm -rf {} \;
88-
find "node_modules/${KEEP_DEP}/lib/binding/v0.8.0/${ADDON_ARCH}" \
90+
find "node_modules/${KEEP_DEP}/lib/binding/v${_DS_VERSION}/${ADDON_ARCH}" \
8991
-mindepth 1 \
9092
-maxdepth 1 \
9193
-type d \

0 commit comments

Comments
 (0)