mirror of
https://github.com/serverless/serverless.git
synced 2025-12-08 19:46:03 +00:00
17 lines
522 B
JavaScript
17 lines
522 B
JavaScript
'use strict';
|
|
|
|
const path = require('path');
|
|
const memoizee = require('memoizee');
|
|
const resolveSync = require('ncjsm/resolve/sync');
|
|
|
|
// This method should be kept as sync. The reason for it is the fact that
|
|
// telemetry generation and persistence needs to be run in sync manner
|
|
// and it depends on this function, either directly or indirectly.
|
|
module.exports = memoizee(() => {
|
|
try {
|
|
return path.resolve(path.dirname(resolveSync(process.cwd(), 'serverless').realPath), '..');
|
|
} catch {
|
|
return null;
|
|
}
|
|
});
|