adapt-authoring-adaptframework 2.5.3 → 2.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -161,7 +161,10 @@ class AdaptFrameworkModule extends AbstractModule {
|
|
|
161
161
|
if (version) {
|
|
162
162
|
this.checkVersionCompatibility(version)
|
|
163
163
|
}
|
|
164
|
-
|
|
164
|
+
if (!version && this.targetVersionRange) {
|
|
165
|
+
version = await this.getLatestVersion()
|
|
166
|
+
}
|
|
167
|
+
await this.runCliCommand('installFramework', { version })
|
|
165
168
|
} catch (e) {
|
|
166
169
|
this.log('error', `failed to install framework, ${e.message}`)
|
|
167
170
|
throw e.statusCode ? e : this.app.errors.FW_INSTALL_FAILED.setData({ reason: e.message })
|
|
@@ -176,7 +179,7 @@ class AdaptFrameworkModule extends AbstractModule {
|
|
|
176
179
|
*/
|
|
177
180
|
async getLatestVersion () {
|
|
178
181
|
try {
|
|
179
|
-
return semver.clean(await this.runCliCommand('getLatestFrameworkVersion', {
|
|
182
|
+
return semver.clean(await this.runCliCommand('getLatestFrameworkVersion', { versionLimit: this.targetVersionRange }))
|
|
180
183
|
} catch (e) {
|
|
181
184
|
this.log('error', `failed to retrieve framework update data, ${e.message}`)
|
|
182
185
|
throw this.app.errors.FW_LATEST_VERSION_FAILED.setData({ reason: e.message })
|
|
@@ -210,7 +213,10 @@ class AdaptFrameworkModule extends AbstractModule {
|
|
|
210
213
|
if (version) {
|
|
211
214
|
this.checkVersionCompatibility(version)
|
|
212
215
|
}
|
|
213
|
-
|
|
216
|
+
if (!version && this.targetVersionRange) {
|
|
217
|
+
version = await this.getLatestVersion()
|
|
218
|
+
}
|
|
219
|
+
await this.runCliCommand('updateFramework', { version })
|
|
214
220
|
this._version = await this.runCliCommand('getCurrentFrameworkVersion')
|
|
215
221
|
} catch (e) {
|
|
216
222
|
this.log('error', `failed to update framework, ${e.message}`)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "adapt-authoring-adaptframework",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.4",
|
|
4
4
|
"description": "Adapt framework integration for the Adapt authoring tool",
|
|
5
5
|
"homepage": "https://github.com/adapt-security/adapt-authoring-adaptframework",
|
|
6
6
|
"license": "GPL-3.0",
|