* 1. Updates root-level packages during local development. (Skipped during CI * because they're guaranteed to be fresh.) * 2. Updates task-level subpackages if a package.json file exists in the task * directory. * @param {string} taskSourceFileName
(taskSourceFileName)
| 69 | * @param {string} taskSourceFileName |
| 70 | */ |
| 71 | function ensureUpdatedPackages(taskSourceFileName) { |
| 72 | if (!isCiBuild()) { |
| 73 | updatePackages(); |
| 74 | } |
| 75 | const taskSourceFilePath = getTaskSourceFilePath(taskSourceFileName); |
| 76 | const packageFile = path.join(taskSourceFilePath, 'package.json'); |
| 77 | const hasSubpackages = fs.pathExistsSync(packageFile); |
| 78 | if (hasSubpackages) { |
| 79 | updateSubpackages(taskSourceFilePath); |
| 80 | } |
| 81 | } |
| 82 | |
| 83 | /** |
| 84 | * Runs an AMP task with logging and timing after installing its subpackages. |
no test coverage detected