| 75 | } |
| 76 | |
| 77 | getReplace() { |
| 78 | if (!this.opts().replace) { |
| 79 | return undefined; |
| 80 | } |
| 81 | if (this.opts().outFile) { |
| 82 | throw 'The --replace and --out-file options cannot be used together.'; |
| 83 | } |
| 84 | if (this.program.args[0]) { |
| 85 | throw 'The --replace and plain input file options cannot be used together.\n' + |
| 86 | 'Did you forget to quote the --replace parameter?'; |
| 87 | } |
| 88 | if (fs.existsSync(this.opts().replace) && fs.statSync(this.opts().replace).isDirectory()) { |
| 89 | return path.join(this.opts().replace, '/**/*.js'); |
| 90 | } |
| 91 | return this.opts().replace; |
| 92 | } |
| 93 | |
| 94 | getTransforms() { |
| 95 | if (!this.opts().transform || this.opts().transform.length === 0) { |