* Ensures that a target is only called with `--files` or `--local_changes` * * @param {string} taskName name of the amp task. * @return {boolean} if the use is valid.
(taskName)
| 142 | * @return {boolean} if the use is valid. |
| 143 | */ |
| 144 | function usesFilesOrLocalChanges(taskName) { |
| 145 | const validUsage = argv.files || argv.local_changes; |
| 146 | if (!validUsage) { |
| 147 | log( |
| 148 | yellow('NOTE 1:'), |
| 149 | 'It is infeasible for', |
| 150 | cyan(`amp ${taskName}`), |
| 151 | 'to check all files in the repo at once.' |
| 152 | ); |
| 153 | log( |
| 154 | yellow('NOTE 2:'), |
| 155 | 'Please run', |
| 156 | cyan(`amp ${taskName}`), |
| 157 | 'with', |
| 158 | cyan('--files'), |
| 159 | 'or', |
| 160 | cyan('--local_changes') + '.' |
| 161 | ); |
| 162 | } |
| 163 | return validUsage; |
| 164 | } |
| 165 | |
| 166 | module.exports = { |
| 167 | buildRuntime, |
no test coverage detected