* Prints an error if the task file and / or function are invalid, and exits. * @param {string} taskSourceFileName * @param {string=} taskFuncName
(taskSourceFileName, taskFuncName)
| 114 | * @param {string=} taskFuncName |
| 115 | */ |
| 116 | function handleInvalidTaskError(taskSourceFileName, taskFuncName) { |
| 117 | log( |
| 118 | red('ERROR:'), |
| 119 | 'Could not find' + (taskFuncName ? ` ${cyan(taskFuncName + '()')} in` : ''), |
| 120 | cyan(path.join('build-system', 'tasks', taskSourceFileName)) + '.' |
| 121 | ); |
| 122 | log( |
| 123 | '⤷ Please check the arguments to', |
| 124 | cyan('createTask()'), |
| 125 | 'in', |
| 126 | cyan('amp.js') + '.' |
| 127 | ); |
| 128 | process.exit(1); |
| 129 | } |
| 130 | |
| 131 | /** |
| 132 | * Returns a task's source file path after making sure it is either a valid JS |
no test coverage detected