mirror of
https://github.com/serverless/serverless.git
synced 2025-12-08 19:46:03 +00:00
18 lines
437 B
JavaScript
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;
|