Skip to content

Commit

Permalink
remove redmatic-canbus (for now), ignore rpi specific nodes in i686 b…
Browse files Browse the repository at this point in the history
…uild, catch error on pkg bundling
  • Loading branch information
hobbyquaker committed Jul 9, 2020
1 parent 05785b1 commit f4a200a
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 9 deletions.
1 change: 0 additions & 1 deletion addon_files/redmatic/lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
"redmatic-homekit": "3.2.0",
"@node-red-contrib-themes/midnight-red": "1.4.0",
"node-red-contrib-doorbird": "0.2.6",
"redmatic-canbus": "1.0.1",
"node-red-contrib-comfoair": "0.0.5",
"node-red-contrib-nukible": "1.0.3",
"node-red-node-discovery": "0.0.22",
Expand Down
11 changes: 9 additions & 2 deletions build_addon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,16 @@ cp $BUILD_DIR/assets/favicon/apple-icon-180x180.png $ADDON_TMP/redmatic/www/
cp $BUILD_DIR/assets/favicon/favicon-96x96.png $ADDON_TMP/redmatic/www/

echo "installing node modules..."
if [ "$ARCH" == "i686" ]; then
echo "removing raspberrypi specific modules..."
mv $ADDON_TMP/redmatic/lib/package.json $ADDON_TMP/redmatic/lib/package.json.tmp
cat $ADDON_TMP/redmatic/lib/package.json.tmp | jq 'del(.dependencies."node-red-contrib-johnny-five",.dependencies."node-red-contrib-rcswitch2")' > $ADDON_TMP/redmatic/lib/package.json
rm $ADDON_TMP/redmatic/lib/package.json.tmp
fi

cd $ADDON_TMP/redmatic/lib
npm install --silent --no-package-lock --production --no-optional --global-style
npm install --slient --no-package-lock --production --global-style ain2
npm install --no-package-lock --production --no-optional --global-style
npm install --no-package-lock --production --global-style ain2
rm $ADDON_TMP/redmatic/lib/package.json

echo "installing additional Node-RED nodes..."
Expand Down
10 changes: 7 additions & 3 deletions build_packages.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,14 @@ fs.writeFileSync(__dirname + '/addon_tmp/redmatic/lib/pkg-repo.json', JSON.strin

remove.forEach(path => {
console.log('remove', path);
if (fs.statSync(path).isDirectory()) {
cp.execSync('rm -r ' + path);
if (fs.existsSync(path)) {
if (fs.statSync(path).isDirectory()) {
cp.execSync('rm -r ' + path);
} else {
fs.unlinkSync(path);
}
} else {
fs.unlinkSync(path);
console.log(path, 'does not exist');
}
});

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "redmatic",
"version": "5.6.0-beta.0",
"version": "5.6.0-beta.1",
"description": "Node-RED packaged as Homematic CCU addon",
"repository": "github:rdmtc/redmatic",
"private": true,
Expand Down Expand Up @@ -53,4 +53,4 @@
"request": "^2.88.0",
"sync-request": "^6.1.0"
}
}
}
2 changes: 1 addition & 1 deletion prebuild_i686.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ DEST="prebuilt/i686"
REMOTE="root@debian-32"
REMOTE_PATH="/root/redmatic-prebuild"

cat addon_files/redmatic/lib/package.json | jq 'del(.dependencies.npm,.dependencies."node-red",.dependencies."@node-red-contrib-themes/midnight-red",.dependencies.node-red-contrib-johnny-five,.dependencies.node-red-contrib-rcswitch2)' > $DEST/package.json
cat addon_files/redmatic/lib/package.json | jq 'del(.dependencies.npm,.dependencies."node-red",.dependencies."@node-red-contrib-themes/midnight-red",.dependencies."node-red-contrib-johnny-five",.dependencies."node-red-contrib-rcswitch2")' > $DEST/package.json

scp $DEST/package.json $REMOTE:$REMOTE_PATH

Expand Down

0 comments on commit f4a200a

Please sign in to comment.