How to use the find function from shelljs

Find comprehensive JavaScript shelljs.find code examples handpicked from public code repositorys.

663
664
665
666
667
668
669
670
671
    };
}

// 1. Update rule meta data by checking rule docs - important to catch removed rules
echo("> Updating rule version meta data (Step 1)");
const ruleDocsFiles = find(DOCS_RULES_DIR);

ruleDocsFiles.forEach((filename, i) => {
    if (test("-f", filename) && path.extname(filename) === ".md") {
fork icon0
star icon0
watch icon1

+ 59 other calls in file

639
640
641
642
643
644
645
646
647
648
const FIXABLE_TEXT = "\n\n(fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule.";
const HAS_SUGGESTIONS_TEXT = "\n\n(hasSuggestions) Some problems reported by this rule are manually fixable by editor [suggestions](../developer-guide/working-with-rules#providing-suggestions).";

// 4. Loop through all files in temporary directory
process.stdout.write("> Updating files (Steps 4-9): 0/... - ...\r");
const tempFiles = find(TEMP_DIR);
const length = tempFiles.length;

tempFiles.forEach((filename, i) => {
    if (test("-f", filename) && path.extname(filename) === ".md") {
fork icon0
star icon0
watch icon0

+ 38 other calls in file

243
244
245
246
247
248
249
250
251
252
        .map(function (name) {
            return path.join(root, name);
        });
}
else {
    items = shell.find(root)
        .filter(function (item) { // filter out the root folder
            return path.normalize(item) != root;
        });
}
fork icon0
star icon0
watch icon0