return command.replaceAll(token, fsPath);
}
const escapedToken = escapeRegExpCharacters(token);
const pattern = new RegExp(
`(["']?)` + escapedToken + `([\\w./\\\\~:-]*)`,
'g',
);
return command.replace(pattern, (_match, leadingQuote: string, suffix: string) => {
const fullPath = fsPath + suffix;
if (leadingQuote) {
return leadingQuote + fullPath;
}
return '"' + fullPath.replace(/"/g, '\\"') + '"';
}
/**