* The static cache path that will be used for this system + options, used if static cache is enabled * @param {Object} options * @return {string}
(options)
| 30 | * @return {string} |
| 31 | */ |
| 32 | function getUserCachePath(options) { |
| 33 | // If we've manually set the static cache location |
| 34 | if (options && options.cacheLocation) { |
| 35 | return resolve(options.cacheLocation) |
| 36 | } |
| 37 | |
| 38 | // Otherwise, find/use the python-ey appdirs cache location |
| 39 | const dirs = new Appdir({ |
| 40 | appName: 'serverless-python-requirements', |
| 41 | appAuthor: 'UnitedIncome', |
| 42 | }) |
| 43 | return dirs.userCache() |
| 44 | } |
| 45 | |
| 46 | /** |
| 47 | * Helper to get the md5 a a file's contents to determine if a requirements has a static cache |