mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-20 18:07:58 +01:00
Fix serialization of commands with embedded new lines in their args but no heredoc support.
This commit is contained in:
@@ -409,7 +409,9 @@ const Commands = Module("commands", {
|
||||
|
||||
let str = args.literalArg;
|
||||
if (str)
|
||||
res.push(/\n/.test(str) ? "<<EOF\n" + str.replace(/\n$/, "") + "\nEOF" : str);
|
||||
res.push(!/\n/.test(str) ? str :
|
||||
this.hereDoc ? "<<EOF\n" + str.replace(/\n$/, "") + "\nEOF"
|
||||
: str.replace(/\n/, "\n" + res[0].replace(/./g, " ").replace(/.$/, "\\")));
|
||||
return res.join(" ");
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user