diff --git a/lib/api.js b/lib/api.js index 345fcf0..f5c6ca6 100644 --- a/lib/api.js +++ b/lib/api.js @@ -81,7 +81,7 @@ class API { // cache state of plugins, as these will be wiped const plugins = (await new Project({ cwd }).getInstallTargets()) .map(p => p.isLocalSource ? p.sourcePath : `${p.name}@${p.requestedVersion}`) - + await this.installFramework({ version, repository, cwd, logger }) // restore plugins await this.installPlugins({ plugins, cwd, logger }) @@ -93,20 +93,22 @@ class API { * @returns {string} */ getCurrentFrameworkVersion ({ - cwd = process.cwd(), + cwd = process.cwd() } = {}) { return new Project({ cwd }).version } - + /** * @param {Object} options + * @param {string} [options.versionLimit] Semver range to constrain the version lookup * @param {Object} [options.repository=ADAPT_FRAMEWORK] The github repository url * @returns {string} */ async getLatestFrameworkVersion ({ + versionLimit, repository = ADAPT_FRAMEWORK } = {}) { - return getLatestVersion({ repository }) + return getLatestVersion({ versionLimit, repository }) } /**