Skip to content

Commit

Permalink
Better logging & postinstall fix
Browse files Browse the repository at this point in the history
  • Loading branch information
beele committed Aug 17, 2020
1 parent 23a00fb commit 730072b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "homebridge-unifi-protect-camera-motion",
"version": "0.4.2",
"version": "0.4.3-beta.1",
"description": "Unifi Protect cameras & motion sensors for Homekit with Homebridge",
"main": "src/index.js",
"scripts": {
Expand Down
3 changes: 2 additions & 1 deletion scripts/postinstall.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ function createCustomBinaryJson(packageUrl) {
let tfjsNodeFolder = process.cwd() + '/node_modules/@tensorflow/tfjs-node/';
let tfjsNodeFolderFound = fs.existsSync(tfjsNodeFolder);
if (!tfjsNodeFolderFound) {
console.log('Using fallback location for tfjs-node');
// Move up in the folder tree two levels.
tfjsNodeFolder = tfjsNodeFolder.replace('homebridge-unifi-protect-camera-motion/node_modules/', '')
tfjsNodeFolderFound = fs.existsSync(tfjsNodeFolder);
Expand All @@ -40,7 +41,7 @@ function createCustomBinaryJson(packageUrl) {
fs.writeFileSync(tfjsNodeFolder + 'scripts/custom-binary.json', JSON.stringify(content, null, 4));

console.log('Running install for tfjs-node again with custom binary specified');
const installProcess = exec('sudo npm install --unsafe-perm=true', {cwd: tfjsNodeFolder});
const installProcess = exec('npm install --unsafe-perm=true', {cwd: tfjsNodeFolder});

installProcess.stdout.pipe(process.stdout);
installProcess.stderr.pipe(process.stderr);
Expand Down

0 comments on commit 730072b

Please sign in to comment.