Skip to content

Commit

Permalink
Added Packages#install (#106)
Browse files Browse the repository at this point in the history
  • Loading branch information
andersevenrud committed Apr 11, 2020
1 parent cda63a3 commit 8e235fd
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/packages.js
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,27 @@ export default class Packages {
[...meta, ...configured].forEach(({name, args}) => this.launch(name, args || {}));
}

/**
* Installs a package
* @param {string} url URL to package
* @param {options} [options]
* @param {boolean} [options.system] Install as system package
*/
install(url, options = {}) {
const body = {
url,
options: Object.assign({}, {
system: false
}, options)
};

return this.core
.request('/api/packages/install', {
method: 'post',
body
});
}

/**
* Registers a package
*
Expand Down

0 comments on commit 8e235fd

Please sign in to comment.