From 56bd4f0ad0b46b0939482ea87d8153f4e9663899 Mon Sep 17 00:00:00 2001 From: Albert Ho Date: Thu, 25 Jan 2024 17:26:31 -0800 Subject: [PATCH] try without mkdirp --- .github/workflows/nodejs-perf.yml | 10 +--------- .github/workflows/nodejs.yml | 2 +- binding/nodejs/copy.js | 13 +++++++++++-- demo/nodejs/package.json | 2 +- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/.github/workflows/nodejs-perf.yml b/.github/workflows/nodejs-perf.yml index 8f4d1c8..c81e3e0 100644 --- a/.github/workflows/nodejs-perf.yml +++ b/.github/workflows/nodejs-perf.yml @@ -61,12 +61,8 @@ jobs: strategy: fail-fast: false matrix: - machine: [rpi2, rpi3-32, rpi3-64, rpi4-32, rpi4-64, jetson, beaglebone] + machine: [rpi3-32, rpi3-64, rpi4-32, rpi4-64, jetson] include: - - machine: rpi2 - num_test_iterations: 20 - init_performance_threshold_sec: 1.0 - proc_performance_threshold_sec: 1.0 - machine: rpi3-32 num_test_iterations: 50 init_performance_threshold_sec: 1.0 @@ -87,10 +83,6 @@ jobs: num_test_iterations: 50 init_performance_threshold_sec: 1.0 proc_performance_threshold_sec: 1.0 - - machine: beaglebone - num_test_iterations: 10 - init_performance_threshold_sec: 1.0 - proc_performance_threshold_sec: 1.0 steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 6c61bdc..2306602 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -53,7 +53,7 @@ jobs: strategy: matrix: - machine: [rpi2, rpi3-32, rpi3-64, rpi4-32, rpi4-64, jetson, beaglebone] + machine: [rpi3-32, rpi3-64, rpi4-32, rpi4-64, jetson] steps: - uses: actions/checkout@v3 diff --git a/binding/nodejs/copy.js b/binding/nodejs/copy.js index e5ed306..88764d2 100644 --- a/binding/nodejs/copy.js +++ b/binding/nodejs/copy.js @@ -10,13 +10,22 @@ // 'use strict'; -const { mkdirp } = require('mkdirp'); +const fs = require('fs'); const ncp = require('ncp').ncp; +const createDirectory = dir => { + try { + fs.mkdirSync(dir, { recursive: true }); + console.log(`Directory '${dir}' created.`); + } catch (err) { + console.error(`Error creating directory '${dir}':`, err); + } +}; + console.log('Copying library files...'); // Library & Model -mkdirp.sync('./lib/common'); +createDirectory('./lib'); ncp('../../lib/node', './lib', function (err) { if (err) { diff --git a/demo/nodejs/package.json b/demo/nodejs/package.json index 96e49ee..7e3f509 100644 --- a/demo/nodejs/package.json +++ b/demo/nodejs/package.json @@ -17,7 +17,7 @@ "license": "Apache-2.0", "dependencies": { "@picovoice/cobra-node": "file:../../binding/nodejs", - "@picovoice/pvrecorder-node": "^1.2.1", + "@picovoice/pvrecorder-node": "~1.2.1", "commander": "^6.1.0", "readline": "^1.3.0", "wavefile": "^11.0.0"