Skip to content

Commit

Permalink
Ensure Node Red userdir exists
Browse files Browse the repository at this point in the history
  • Loading branch information
helander committed Jan 16, 2024
1 parent b4cbc27 commit 5cafa6e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"private": true,
"private": false,
"displayName": "Node Red plugin for Homebridge",
"name": "@helander/homebridge-node-red",
"version": "2.0.0",
"version": "2.0.1",
"description": "Run Node Red inside Homebridge.",
"license": "Apache-2.0",
"repository": {
Expand Down
1 change: 1 addition & 0 deletions src/platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export class NodeRedHomebridgePlatform implements DynamicPlatformPlugin {
};

// On first startup, create a hb-conf node representing the local homebridge.
if (!fs.existsSync(settings.userDir)) fs.mkdirSync(settings.userDir);

Check warning on line 72 in src/platform.ts

View workflow job for this annotation

GitHub Actions / build (18.x)

Expected { after 'if' condition

Check warning on line 72 in src/platform.ts

View workflow job for this annotation

GitHub Actions / build (20.x)

Expected { after 'if' condition
const flowFilePath = `${settings.userDir}/${settings.flowFile}`;
if (!fs.existsSync(flowFilePath)) {
this.log.info('Flows file did not exist => create one with a hb-config included');
Expand Down

0 comments on commit 5cafa6e

Please sign in to comment.