Skip to content

Commit

Permalink
fix(CLI): Fix local installation fallback
Browse files Browse the repository at this point in the history
Older versions expose just `serverless.isInvokedByGlobalInstallation` property, not `serverless._isInvokedByGlobalInstallation`
  • Loading branch information
medikoo committed May 11, 2021
1 parent 4d077d1 commit fa8c076
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/cli/handle-error.js
Expand Up @@ -51,7 +51,7 @@ module.exports = async (exception, options = {}) => {

const isLocallyInstalled = serverless ? serverless.isLocallyInstalled : passedIsLocallyInstalled;
const isInvokedByGlobalInstallation = serverless
? serverless._isInvokedByGlobalInstallation
? serverless.isInvokedByGlobalInstallation
: passedIsInvokedByGlobalInstallation;

if (isInvokedByGlobalInstallation) {
Expand Down
2 changes: 1 addition & 1 deletion lib/utils/telemetry/generatePayload.js
Expand Up @@ -151,7 +151,7 @@ module.exports = async (serverless = null) => {
if (!isLocallyInstalled) {
return (await isNpmGlobal()) ? 'global:npm' : 'global:other';
}
if (serverless && serverless._isInvokedByGlobalInstallation) return 'local:fallback';
if (serverless && serverless.isInvokedByGlobalInstallation) return 'local:fallback';
return 'local:direct';
})(),
isAutoUpdateEnabled: Boolean(userConfig.get('autoUpdate.enabled')),
Expand Down

0 comments on commit fa8c076

Please sign in to comment.