Skip to content

ignore all, authorize callback ? #71

Description

@jonlepage

Hey this tool are awesome thanks.
One thing, we really need support ignore all
Any tips to do this
Example i want allow only if is a files, and the extension is .json and .webm

        const scanDATA2 = () => {
            const recursive = require('recursive-readdir');
            function ignoreFunc(file, stats) {
                const isDirectory = stats.isDirectory();
                if(stats.isDirectory()){
                    return file.contains('SOURCE') || file.contains('source');
                }else
                if(stats.isFile()){
                    return !(['.json','.webm'].contains(file));
                };
              };
              recursive("data2", [ignoreFunc], (err, files) => {
                files.forEach(PATH => {
                    const split = PATH.replace('.','\\').split('\\');
                    const name = split[split.length-2];
                    if(name.contains('-')){ // isMultipack
                        const _name = name.split('-')[0]; // nom sans -0
                        !this.LINKS[_name] && (this.LINKS[_name] = []);
                        this.LINKS[_name].push( {name:name,path:PATH.replace(/\\/g,"/")} );
                    }else{
                        this.LINKS[name] = PATH.replace(/\\/g,"/");
                    };
                });
                return nextStep();
              });
        };

the issue with the ignore files, is if a user add a new file in folder, it will scan.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions