* The `_readManifest` method reads the on-disk manifest for the current * cache and returns its value. * * @private * @method _readManifest * @param {String} label The label for the cache. * @param {String} type The type of package cache. * @return {String} The manifest file con
(label, type)
| 286 | * @return {String} The manifest file contents on disk. |
| 287 | */ |
| 288 | _readManifest(label, type) { |
| 289 | let readManifestDir = this.dirs[label]; |
| 290 | |
| 291 | if (!readManifestDir) { |
| 292 | return null; |
| 293 | } |
| 294 | |
| 295 | let inputPath = path.join(readManifestDir, translate(type, 'manifest')); |
| 296 | |
| 297 | let result = null; |
| 298 | try { |
| 299 | result = fs.readFileSync(inputPath, 'utf8'); |
| 300 | } catch (error) { |
| 301 | // Swallow non-exceptional errors. |
| 302 | if (error.code !== 'ENOENT') { |
| 303 | throw error; |
| 304 | } |
| 305 | } |
| 306 | return result; |
| 307 | } |
| 308 | |
| 309 | /** |
| 310 | * The `_writeManifest` method generates the on-disk folder for the package cache |
no test coverage detected