Skip to content

Updated fs-lister to allow folder patterns, choose to look at files, folders or both and updated the documentation #17

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

Merged
merged 22 commits into from
Jan 6, 2020

Conversation

juggledad
Copy link
Contributor

We welcome new pull requests to this repository but please follow the contribution guidelines.

Ensure that you are happy with the license for this repository and that all of your code meets the requirements for the license.

Please include the following information:

A reference to any related issues in this repository

A description of the changes proposed in the pull request and why

Updated fs-lister to allow folder patterns, choose to look at files, folders or both and updated the documentation

Environment used for development and testing

Software Version
Node.JS v10.17.0 (1) and v12.13.0 (2)
npm 6.11.3 (1) and 6.13.4 (2)
Node-RED 1.0.3
fs node lister
OS Rpi (1) and macOS (2)
Browser Safari

- changed 'Include hidden files in output?' option to only pertain to files. If you want to search for hidden folders you need to add that to the folder filter.
- added file filter (pattern) defaults to *.*
- added code to deal with all pattterns in file filter when 'Include hidden files in output?' is set
- set folder filter default to *
- folder filter will accept '/' and convert them to commas before sending to readdirp
- both file filter and folder filter are converted to arrays to be passes to readdirp
added new 'show folder only' option
Added a folder list option, cleaned up INFO documentation
changed 'Include hidden files in output?' option to only pertain to files. If you want to search for hidden folders you need to add that to the folder filter.
file filter (pattern) defaults to a *.*
added code to deal with all pattterns in file filter when 'Include hidden files in output?' is set
folder filter defaults to *
folder filter will accept '/' and convert them to commas before sending to readdirp
both file filter and folder filter are converted to arrays to be passes to readdirp
added option to return folder names only
allow and y of the options to be ovr ridden
added file/folder option
added code to support the changes made to fs-file-lister.js
added 'both' as a file list type and expanced the explanation. in the js 'both' will be changed to 'files_directories' whic is the actual option
fixed lstype to change 'both' to 'files_directories' the correct option
removed 'To DO' section
added instructions for passing all the options
Add more over rides
finished adding overrides
changed how 'overides' is displaying
added
if (node.lstype == 'folders') {node.lstype = 'directories'}
fixed two comments to line up like others
Moved the two lines
            
            if (node.lstype == 'folders') {node.lstype = 'directories'}
            if (node.lstype == 'both') {node.lstype = 'files_directories'}

above the cloneMsg.config build so the actual values will show up
added a default value to lstype to oneditprepare
in the .onprepare commented a line and added two others
//        if ( this.lstype === undefined ) this.lstype = "Files"
        if ( this.lstype === undefined ) this.lstype = "files"
        $('#node-input-lstype').prop('Files', this.lstype)
added 
$('#node-input-lstype').val(this.lstype || 'Files')
to the
oneditprepare: function() {
which solves the problem of creating the Files/Folder label for old versions of the FS-lister node.
described the updates for v1.1.2
Updated the documentation to reflect how the node currently works with the new options added.
need to add this
if ( this.lstype === undefined ) this.lstype = "Files"
to  oneditprepare: function () {
corrected the code so that existing nodes will show the label 'Files' when they are opened and it will default to that during runtime.
Added note to v1.1.2 updates that more data could be returned to existing nodes due to the additional functionality
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants