Skip to content

Voice-to-text dictation app with local (Nvidia Parakeet/Whisper) and cloud models (BYOK). Privacy-first and available cross-platform.

fix(windows): use relative paths in sherpa-onnx tar extraction (#284)

iBasicTutorials5481f318dc77
diff --git a/.github/workflows/build-and-notarize.yml b/.github/workflows/build-and-notarize.yml
index ec450faf0..48f103a02 100644
--- a/.github/workflows/build-and-notarize.yml
+++ b/.github/workflows/build-and-notarize.yml
@@ -39,17 +39,17 @@ jobs:
- name: Download whisper.cpp binaries
run: node scripts/download-whisper-cpp.js --current
env:
- GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
+ GITHUB_TOKEN: ${{ secrets.GH_TOKEN || github.token }}
- name: Download llama-server binaries
run: node scripts/download-llama-server.js --current
env:
- GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
+ GITHUB_TOKEN: ${{ secrets.GH_TOKEN || github.token }}
- name: Download sherpa-onnx binaries
run: node scripts/download-sherpa-onnx.js --current
env:
- GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
+ GITHUB_TOKEN: ${{ secrets.GH_TOKEN || github.token }}
- name: Cache Electron
uses: actions/cache@v4
@@ -66,7 +66,7 @@ jobs:
- name: Build Application
run: npm run build:linux -- --publish never
env:
- GH_TOKEN: ${{ secrets.GH_TOKEN }}
+ GH_TOKEN: ${{ secrets.GH_TOKEN || github.token }}
VITE_NEON_AUTH_URL: ${{ vars.VITE_NEON_AUTH_URL }}
VITE_OPENWHISPR_API_URL: ${{ vars.VITE_OPENWHISPR_API_URL }}
VITE_OPENWHISPR_OAUTH_CALLBACK_URL: ${{ vars.VITE_OPENWHISPR_OAUTH_CALLBACK_URL }}
@@ -101,22 +101,22 @@ jobs:
- name: Download whisper.cpp binaries
run: node scripts/download-whisper-cpp.js --current
env:
- GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
+ GITHUB_TOKEN: ${{ secrets.GH_TOKEN || github.token }}
- name: Download llama-server binaries
run: node scripts/download-llama-server.js --current
env:
- GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
+ GITHUB_TOKEN: ${{ secrets.GH_TOKEN || github.token }}
- name: Download sherpa-onnx binaries
run: node scripts/download-sherpa-onnx.js --current
env:
- GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
+ GITHUB_TOKEN: ${{ secrets.GH_TOKEN || github.token }}
- name: Download nircmd.exe
run: node scripts/download-nircmd.js
env:
- GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
+ GITHUB_TOKEN: ${{ secrets.GH_TOKEN || github.token }}
- name: Download windows-fast-paste.exe
run: node scripts/download-windows-fast-paste.js
@@ -138,7 +138,7 @@ jobs:
- name: Build Application
run: npm run build:win -- --publish never
env:
- GH_TOKEN: ${{ secrets.GH_TOKEN }}
+ GH_TOKEN: ${{ secrets.GH_TOKEN || github.token }}
VITE_NEON_AUTH_URL: ${{ vars.VITE_NEON_AUTH_URL }}
VITE_OPENWHISPR_API_URL: ${{ vars.VITE_OPENWHISPR_API_URL }}
VITE_OPENWHISPR_OAUTH_CALLBACK_URL: ${{ vars.VITE_OPENWHISPR_OAUTH_CALLBACK_URL }}
@@ -177,17 +177,17 @@ jobs:
- name: Download whisper.cpp binaries
run: node scripts/download-whisper-cpp.js --current --platform darwin --arch ${{ matrix.arch }}
env:
- GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
+ GITHUB_TOKEN: ${{ secrets.GH_TOKEN || github.token }}
- name: Download llama-server binaries
run: node scripts/download-llama-server.js --current --platform darwin --arch ${{ matrix.arch }}
env:
- GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
+ GITHUB_TOKEN: ${{ secrets.GH_TOKEN || github.token }}
- name: Download sherpa-onnx binaries
run: node scripts/download-sherpa-onnx.js --current --platform darwin --arch ${{ matrix.arch }}
env:
- GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
+ GITHUB_TOKEN: ${{ secrets.GH_TOKEN || github.token }}
- name: Cache Electron
uses: actions/cache@v4
@@ -225,7 +225,7 @@ jobs:
run: npm run build:mac -- --${{ matrix.arch }} --publish never
env:
TARGET_ARCH: ${{ matrix.arch }}
- GH_TOKEN: ${{ secrets.GH_TOKEN }}
+ GH_TOKEN: ${{ secrets.GH_TOKEN || github.token }}
VITE_NEON_AUTH_URL: ${{ vars.VITE_NEON_AUTH_URL }}
VITE_OPENWHISPR_API_URL: ${{ vars.VITE_OPENWHISPR_API_URL }}
VITE_OPENWHISPR_OAUTH_CALLBACK_URL: ${{ vars.VITE_OPENWHISPR_OAUTH_CALLBACK_URL }}
diff --git a/scripts/download-sherpa-onnx.js b/scripts/download-sherpa-onnx.js
index 0e07084f8..772db7a0d 100644
--- a/scripts/download-sherpa-onnx.js
+++ b/scripts/download-sherpa-onnx.js
@@ -1,7 +1,7 @@
#!/usr/bin/env node
const fs = require("fs");
const path = require("path");
-const { execSync } = require("child_process");
+const { execFileSync } = require("child_process");
const {
downloadFile,
findBinaryInDir,
@@ -50,8 +50,13 @@ function getDownloadUrl(archiveName) {
function extractTarBz2(archivePath, destDir) {
fs.mkdirSync(destDir, { recursive: true });
- // tar is available on Windows 10+ and all Unix systems
- execSync(`tar -xjf "${archivePath}" -C "${destDir}"`, { stdio: "inherit" });
+ // Use relative paths from archive dir as cwd, so neither -f nor -C args
+ // contain Windows drive letter colons (GNU tar treats C: as remote host)
+ const cwd = path.dirname(archivePath);
+ execFileSync("tar", ["-xjf", path.basename(archivePath), "-C", path.relative(cwd, destDir)], {
+ stdio: "inherit",
+ cwd,
+ });
}
function findLibrariesInDir(dir, pattern, maxDepth = 5, currentDepth = 0) {