mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-22 22:57:58 +01:00
Make io.system a bit less silly.
This commit is contained in:
@@ -726,22 +726,20 @@ lookup:
|
|||||||
return this.withTempFiles(function (stdin, stdout, stderr, cmd) {
|
return this.withTempFiles(function (stdin, stdout, stderr, cmd) {
|
||||||
|
|
||||||
if (input)
|
if (input)
|
||||||
{
|
|
||||||
this.writeFile(stdin, input);
|
this.writeFile(stdin, input);
|
||||||
command += " <" + escape(stdin.path);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (WINDOWS)
|
if (WINDOWS)
|
||||||
{
|
{
|
||||||
command = "cd /D " + cwd.path + " && " + command + " > " + stdout.path + " 2> " + stderr.path;
|
command = "cd /D " + cwd.path + " && " + command + " > " + stdout.path + " 2> " + stderr.path + " < " + stdin.path;
|
||||||
var res = this.run(options["shell"], options["shellcmdflag"].split(/\s+/).concat(command), true);
|
var res = this.run(options["shell"], options["shellcmdflag"].split(/\s+/).concat(command), true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
this.writeFile(cmd, Array.concat("exec", options["shell"], options["shellcmdflag"].split(/\s+/), command).map(escape).join(" "));
|
|
||||||
command = "cd " + escape(cwd.path) + ' && eval "$(cat <' + escape(cmd.path) + ')" >' + escape(stdout.path) + " 2>" + escape(stderr.path);
|
this.writeFile(cmd, "cd " + escape(cwd.path) + "\n" +
|
||||||
liberator.dump("command: " + command);
|
["exec", ">" + escape(stdout.path), "2>" + escape(stderr.path), "<" + escape(stdin.path),
|
||||||
res = this.run("/bin/sh", ["-c", command], true);
|
escape(options["shell"]), options["shellcmdflag"], escape(command)].join(" "));
|
||||||
|
res = this.run("/bin/sh", ["-e", cmd.path], true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (res > 0) // FIXME: Is this really right? Shouldn't we always show both?
|
if (res > 0) // FIXME: Is this really right? Shouldn't we always show both?
|
||||||
|
|||||||
Reference in New Issue
Block a user