mirror of
https://github.com/serverless/serverless.git
synced 2025-12-08 19:46:03 +00:00
17 lines
450 B
JavaScript
17 lines
450 B
JavaScript
'use strict';
|
|
|
|
const homedir = require('os').homedir();
|
|
const path = require('path');
|
|
const crypto = require('crypto');
|
|
|
|
const getCacheFilePath = function(srvcPath) {
|
|
const servicePath = srvcPath || process.cwd();
|
|
const servicePathHash = crypto
|
|
.createHash('sha256')
|
|
.update(servicePath)
|
|
.digest('hex');
|
|
return path.join(homedir, '.serverless', 'cache', servicePathHash, 'autocomplete.json');
|
|
};
|
|
|
|
module.exports = getCacheFilePath;
|