MCPcopy Index your code
hub / github.com/ampproject/amphtml / usesFilesOrLocalChanges

Function usesFilesOrLocalChanges

build-system/common/utils.js:144–164  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

142 * @return {boolean} if the use is valid.
143 */
144function 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
166module.exports = {
167 buildRuntime,

Callers 2

checkOwnersFunction · 0.85
checkLinksFunction · 0.85

Calls 3

yellowFunction · 0.85
cyanFunction · 0.85
logFunction · 0.70

Tested by

no test coverage detected