Accept a string path in Zotero.Utilities.Internal.exec()

This commit is contained in:
Dan Stillman 2015-04-07 01:15:13 -04:00
parent 31941c0798
commit adadc9e03a

View file

@ -290,11 +290,16 @@ Zotero.Utilities.Internal = {
/**
* Launch a process
* @param {nsIFile} cmd Path to command to launch
* @param {nsIFile|String} cmd Path to command to launch
* @param {String[]} args Arguments given
* @return {Promise} Promise resolved to true if command succeeds, or an error otherwise
*/
"exec":function(cmd, args) {
if (typeof cmd == 'string') {
Components.utils.import("resource://gre/modules/FileUtils.jsm");
cmd = new FileUtils.File(cmd);
}
if(!cmd.isExecutable()) {
return Q.reject(cmd.path+" is not an executable");
}