Skip to content

Prevent error when local plugin not found #219

@chris-steele

Description

@chris-steele

If the database indicates a plugin is installed locally, but the plugin is not on disk (or bower registered), an uncaught error is thrown. This can have the effect of halting the installation of framework plugins which results in various issues, the first evidence often being a missing schema error.

See also: #204, #180

/**
* whether querying the server or disk for plugin information worked
* @returns {boolean}
*/
get isPresent () {
return Boolean(this._projectInfo || this._sourceInfo)
}

if (this.isLocalSource) {
const info = this.projectVersion ? this._projectInfo : this._sourceInfo
const satisfiesConstraint = !this.hasValidRequestVersion || semver.satisfies(info.version, this.requestedVersion, semverOptions)
const satisfiesFramework = semver.satisfies(framework, info.framework)
if (satisfiesFramework && satisfiesConstraint) this.latestCompatibleSourceVersion = info.version
return info.version
}
if (!this.isPresent) return null
// check if the latest version is compatible
const satisfiesConstraint = !this.hasValidRequestVersion || semver.satisfies(this._sourceInfo.version, this.requestedVersion, semverOptions)

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions