diff --git a/lib/AdaptFrameworkModule.js b/lib/AdaptFrameworkModule.js index 678ba92..6e9ad80 100644 --- a/lib/AdaptFrameworkModule.js +++ b/lib/AdaptFrameworkModule.js @@ -31,7 +31,7 @@ class AdaptFrameworkModule extends AbstractModule { * @type {Hook} */ this.postUpdateHook = new Hook() - + /** * Invoked prior to a course being built. The AdaptFrameworkBuild instance is passed to any observers. * @type {Hook} @@ -68,17 +68,21 @@ class AdaptFrameworkModule extends AbstractModule { * Installs a local copy of the Adapt framework * @return {Promise} */ - async installFramework () { + async installFramework (version, force = false) { try { const modsPath = path.resolve(this.path, '..', 'node_modules') try { await fs.stat(modsPath) await fs.readJson(path.resolve(this.path, 'package.json')) - return + if (!force) { + return + } + await fs.remove(this.path) } catch (e) { // if src and node_modules are missing, install required } await AdaptCli.installFramework({ + version, repository: this.getConfig('frameworkRepository'), cwd: this.path })