Merge pull request #2003 from saulrh/rc-linejoin

Teach config-rc to string-join lines ending with \
This commit is contained in:
Oliver Blanthorn 2019-11-17 18:56:11 +00:00 committed by GitHub
commit 30fb7cbe0a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -50,7 +50,11 @@ export async function runRc(rc: string) {
}
export function rcFileToExCmds(rcText: string): string[] {
const excmds = rcText.split("\n")
// string-join lines that end with /
const joined = rcText.replace(/\\\n/g, "")
// Split into individual excmds
const excmds = joined.split("\n")
// Remove empty and comment lines
return excmds.filter(x => /\S/.test(x) && !x.trim().startsWith('"'))