serverless/lib/utils/getCacheFile.js
2021-04-16 13:32:13 +02:00

18 lines
437 B
JavaScript

'use strict';
const fileExists = require('./fs/fileExists');
const readFile = require('./fs/readFile');
const getCacheFilePath = require('./getCacheFilePath');
const getCacheFile = function (serviceDir) {
const cacheFilePath = getCacheFilePath(serviceDir);
return fileExists(cacheFilePath).then((exists) => {
if (!exists) {
return false;
}
return readFile(cacheFilePath);
});
};
module.exports = getCacheFile;