Add support for {{P|userprofile\appdata\locallow}}

This commit is contained in:
mtkennerly 2021-01-03 23:10:22 -05:00
parent 640ad5e474
commit 4d570f1790
3 changed files with 65 additions and 57 deletions

View file

@ -151,6 +151,10 @@ const PATH_ARGS: { [arg: string]: { mapped: string, when?: Constraint, registry?
mapped: "<winDocuments>",
when: { os: "windows" },
},
"userprofile\\appdata\\locallow": {
mapped: "<winAppData>/LocalLow",
when: { os: "windows" },
},
appdata: {
mapped: "<winAppData>",
when: { os: "windows" },
@ -199,10 +203,10 @@ const PATH_ARGS: { [arg: string]: { mapped: string, when?: Constraint, registry?
function makePathArgRegex(arg: string): RegExp {
const escaped = `{{P(ath)?|${arg}}}`
.replace("\\", "\\\\")
.replace("|", "\\|")
.replace("{", "\\{")
.replace("}", "\\}");
.replace(/\\/g, "\\\\")
.replace(/\|/g, "\\|")
.replace(/\{/g, "\\{")
.replace(/\}/g, "\\}");
return new RegExp(escaped, "gi");
}