Skip to content

Commit 9a48770

Browse files
committed
Update index.js
1 parent f4ec490 commit 9a48770

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

index.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,17 @@ export const packager = Sys.packager = function () {
9090
/**
9191
* Install package using the system package manager command.
9292
*
93-
* @returns {string} Output of spawn command.
93+
* @param {String|Array} application package to install.
94+
* @param {Function} progress callback for any output doing installation.
95+
* - Any value returned in `callback` will be the final resolved result.
96+
*
97+
* @returns {Promise} Promise Output of spawn command.
9498
* - E.g. 'sudo apg-get install' for Debian based systems.
9599
* - Defaults to 'get os-manager installer' if no package manager is found.
96-
* @throws Throws if `process.platform` is none of darwin, freebsd, linux, sunos or win32.
100+
* @rejects On any spawn error, or if `process.platform` is none of
101+
* darwin, freebsd, linux, sunos or win32.
97102
*/
98-
export const installer = Sys.installer = function (application, progress = () => { }) {
103+
export const installer = Sys.installer = function (application, progress) {
99104
if (!application)
100105
return new Promise((resolve, reject) => { return reject("No package, application name missing."); });
101106

@@ -114,7 +119,7 @@ export const installer = Sys.installer = function (application, progress = () =>
114119
let system = whatToInstall;
115120
if ((args) && (!install))
116121
system = args.concat(whatToInstall);
117-
if ((args) && (install))
122+
else if ((args) && (install))
118123
system = args.concat(install).concat(whatToInstall);
119124

120125
if (cmd != 'powershell') {

0 commit comments

Comments
 (0)