Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Latest version (1.3.0/1) ignores 'start' parameter (solution in text) #19

Closed
juggledad opened this issue Jan 14, 2020 · 2 comments
Closed
Assignees
Labels

Comments

@juggledad
Copy link
Contributor

juggledad commented Jan 14, 2020

The latest version of fs-lister is ignoring the 'start' parameter when it is passed into the node. In the code at line 198 this:
readdirp(path.join(node.start), options)
should be changed to this:
readdirp(path.join(clonedMsg.config.start), options)

Software and Package Versions

Software Version
Node.JS v12.13.0
npm 6.13.4
Node-RED v1.0.3
fs node 1.3.1
OS macOS
Browser Safari

How is Node-RED installed? Where is uibuilder installed?

No uibuilder
NR installed per NR normally

@juggledad juggledad changed the title Latest version ignores 'start' parameter Latest version (1.3.0/1) ignores 'start' parameter Jan 14, 2020
@juggledad juggledad changed the title Latest version (1.3.0/1) ignores 'start' parameter Latest version (1.3.0/1) ignores 'start' parameter (solution in text) Jan 14, 2020
@juggledad
Copy link
Contributor Author

Here is a simple example of two flows. This is for running on a Pi. The idea is to look for the file "settings.js" in the /home/pi/.node-red' folder.

Screen Shot 2020-01-15 at 6 26 16 AM

CASE 1 has all the options in the fs file lister node

while

CASE 2 passs all the options in msg.payload.

[{"id":"c4660d28.b7e31","type":"inject","z":"9d6e4527.18bf3","name":"CASE 1 - options all in fs-lister","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":190,"y":440,"wires":[["c7b8b65a.2a247"]]},{"id":"c7b8b65a.2a247","type":"fs-file-lister","z":"9d6e4527.18bf3","name":"","start":"/home/pi/.node-red","pattern":"settings.js","folders":"*","hidden":false,"lstype":"files","path":true,"single":true,"depth":"1","stat":false,"showWarnings":true,"x":500,"y":440,"wires":[["96e2367d.c84d98"]]},{"id":"96e2367d.c84d98","type":"debug","z":"9d6e4527.18bf3","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":650,"y":440,"wires":[]},{"id":"23cec9a0.0a26d6","type":"inject","z":"9d6e4527.18bf3","name":"CASE 2 - options PASSED INTO fs-lister","topic":"","payload":"{\"start\":\"/home/pi/songs\",\"depth\":1,\"pattern\":\"settings.js\"}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":220,"y":500,"wires":[["5a0b0d1d.e63064"]]},{"id":"5a0b0d1d.e63064","type":"fs-file-lister","z":"9d6e4527.18bf3","name":"","start":"/","pattern":"*.*","folders":"*","hidden":false,"lstype":"files","path":true,"single":true,"depth":"0","stat":false,"showWarnings":true,"x":500,"y":500,"wires":[["705fce68.f8c41"]]},{"id":"705fce68.f8c41","type":"debug","z":"9d6e4527.18bf3","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":650,"y":500,"wires":[]}]

If you look at msg.config in the two debugs you will see hey are identical. The problem is in the code, it calls readdirp passing node.start which never gets updated with what's passed in from msg.payload. However clonedMsg.config.start is properly updated if the start is passed in msg.payload

TotallyInformation added a commit that referenced this issue Jan 15, 2020
@TotallyInformation
Copy link
Owner

Fixed in v1.3.2 now pushed. Will be published shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants