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

ignore all, authorize callback ? #71

Open
jonlepage opened this issue May 26, 2019 · 0 comments
Open

ignore all, authorize callback ? #71

jonlepage opened this issue May 26, 2019 · 0 comments

Comments

@jonlepage
Copy link

jonlepage commented May 26, 2019

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.

@jonlepage jonlepage changed the title ignore all ignore all, authorize callback ? May 26, 2019
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

No branches or pull requests

1 participant