mirror of
https://github.com/serverless/serverless.git
synced 2026-01-18 14:58:43 +00:00
25 lines
839 B
JavaScript
25 lines
839 B
JavaScript
'use strict';
|
|
|
|
// const BbPromise = require('bluebird');
|
|
// const childProcess = BbPromise.promisifyAll(require('child_process'));
|
|
//
|
|
// function localEmulatorInsatlled() {
|
|
// const stdout = childProcess.execSync('npm list -g serverless-local-emulator');
|
|
// const stdoutString = new Buffer(stdout, 'base64').toString();
|
|
// return stdoutString.includes('serverless-local-emulator');
|
|
// }
|
|
//
|
|
// module.exports = localEmulatorInsatlled;
|
|
|
|
const path = require('path');
|
|
const os = require('os');
|
|
const fileExistsSync = require('../../../utils/fs/fileExistsSync');
|
|
|
|
function localEmulatorInstalled() {
|
|
const localEmulatorPackageJsonFilePath = path
|
|
.join(os.homedir(), 'node_modules', 'serverless-local-emulator', 'package.json');
|
|
return fileExistsSync(localEmulatorPackageJsonFilePath);
|
|
}
|
|
|
|
module.exports = localEmulatorInstalled;
|