![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/mets.corals.io/wp-content/themes/metras/node_modules/.bin/ |
#!/usr/bin/env node var findup = require('..'), path = require('path'), pkg = require('../package'), program = require('commander'), options = {}, optionKeys = ['name', 'dir', 'verbose'], EXIT_FAILURE = -1; program .version(pkg.version) .option('--name <name>', 'The name of the file to find', String) .option('--dir <dir>', 'The directoy where we will start walking up', process.cwd(), path) .option('--verbose', 'print log', false, Boolean) .parse(process.argv); optionKeys.forEach(function(optionKey){ options[optionKey] = program[optionKey]; }); if(program.args && program.args.length >=1 && !options.name){ options.name = program.args[0]; } if(!options.name) { program.outputHelp(); process.exit(EXIT_FAILURE); } var file = options.name; findup(process.cwd(), file, options, function(err, dir){ if(err) return console.error(err.message ? err.message : err); console.log(path.join(dir, file)); });