Sanitize extension name to match vscode sudo prompt name requirements
This commit is contained in:
Родитель
058f56ec4c
Коммит
83d2d7d8ef
|
@ -86,7 +86,9 @@ Please install the .NET SDK manually by following https://learn.microsoft.com/en
|
|||
return new Promise<string>((resolve, reject) =>
|
||||
{
|
||||
// The '.' character is not allowed for sudo-prompt so we use 'NET'
|
||||
const options = { name: `${this.context?.acquisitionContext?.requestingExtensionId} On behalf of NET Install Tool` };
|
||||
let sanitizedCallerName = this.context?.acquisitionContext?.requestingExtensionId?.replace(/[^0-9a-z]/gi, ''); // Remove non-alphanumerics per OS requirements
|
||||
sanitizedCallerName = sanitizedCallerName?.substring(0, 69); // 70 Characters is the maximum limit we can use for the prompt.
|
||||
const options = { name: `${sanitizedCallerName ?? '.NET Install Tool'}` };
|
||||
exec((fullCommandString), options, (error?: any, stdout?: any, stderr?: any) =>
|
||||
{
|
||||
let commandResultString = '';
|
||||
|
|
Загрузка…
Ссылка в новой задаче