(name, devBundleDir)
| 37 | }; |
| 38 | |
| 39 | function isValidCommand(name, devBundleDir) { |
| 40 | if (name === "node" || |
| 41 | name === "npm" || |
| 42 | name === "npx") { |
| 43 | return true; |
| 44 | } |
| 45 | |
| 46 | if (! name || name.charAt(0) === ".") { |
| 47 | // Disallow empty commands and commands that start with a period. |
| 48 | return false; |
| 49 | } |
| 50 | |
| 51 | var meteorCommandsJsonPath = |
| 52 | path.join(devBundleDir, "bin", ".meteor-commands.json"); |
| 53 | |
| 54 | try { |
| 55 | var meteorCommands = require(meteorCommandsJsonPath); |
| 56 | } catch (e) { |
| 57 | return false; |
| 58 | } |
| 59 | |
| 60 | // If `meteor <name>` is already a Meteor command, don't let anything in |
| 61 | // dev_bundle/bin override it. |
| 62 | return ! hasOwn.call(meteorCommands, name); |
| 63 | } |
| 64 | |
| 65 | exports.getEnv = function (options) { |
| 66 | var devBundle = options && options.devBundle; |
no test coverage detected
searching dependent graphs…