Accept a string path in Zotero.Utilities.Internal.exec()
This commit is contained in:
parent
31941c0798
commit
adadc9e03a
1 changed files with 6 additions and 1 deletions
|
@ -290,11 +290,16 @@ Zotero.Utilities.Internal = {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Launch a process
|
* 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
|
* @param {String[]} args Arguments given
|
||||||
* @return {Promise} Promise resolved to true if command succeeds, or an error otherwise
|
* @return {Promise} Promise resolved to true if command succeeds, or an error otherwise
|
||||||
*/
|
*/
|
||||||
"exec":function(cmd, args) {
|
"exec":function(cmd, args) {
|
||||||
|
if (typeof cmd == 'string') {
|
||||||
|
Components.utils.import("resource://gre/modules/FileUtils.jsm");
|
||||||
|
cmd = new FileUtils.File(cmd);
|
||||||
|
}
|
||||||
|
|
||||||
if(!cmd.isExecutable()) {
|
if(!cmd.isExecutable()) {
|
||||||
return Q.reject(cmd.path+" is not an executable");
|
return Q.reject(cmd.path+" is not an executable");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue