Skip to content

Commit

Permalink
Add support for custom version install
Browse files Browse the repository at this point in the history
  • Loading branch information
taylortom committed Sep 2, 2024
1 parent addaed6 commit 822c298
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/AdaptFrameworkModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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
})
Expand Down

0 comments on commit 822c298

Please sign in to comment.