fatoldsun00 / node-red-contrib-watchdirectory

Watch directory for create, update, delete event
9 stars 6 forks source link

Node Red Environment Variable #10

Open ioideanh opened 2 years ago

ioideanh commented 2 years ago

I'm using this is a subflow can the folder config be address with an Environment Variable

I have tried using ${HOT_FOLDER} but it does not seem to work.

Where HOT_FOLDER is a config for my subflow. thanks

fatoldsun00 commented 2 years ago

Hi,

I don't work with node red from 2 years, but i had use node var env for config this node.

In code we have : this.folder = path.normalize(RED.util.evaluateNodeProperty(config.folder, this.folderType, this))

so if you create a var env for your nodered instance it would be works

test to display your var env in a fn node, see if your config file it's correctly load.

elmigbot commented 2 years ago

Support for context variables was added to this repository, but the npm package and node-red nodes were never updated. Hence, this will not work unless you replace the files in your local node-red-contrib-watchdirectory with the new ones in this repository. There are two of them, node-red-watchdirectory.js and node-red-watchdirectory.html. Restart nodered.

Once done, don't forget to change the folder type to JSONATA expression.

Unfortunately, when the folder var changes, the flow must be restarted for the change to apply.