Fix extension logs

Refactor utils.addCommand
This commit is contained in:
Shivam Mathur
2023-01-18 09:00:28 +05:30
parent 6db1a06425
commit bbc65d999a
10 changed files with 94 additions and 69 deletions

View File

@ -320,7 +320,14 @@ export async function getCommand(os: string, suffix: string): Promise<string> {
case 'darwin':
return 'add_' + suffix + ' ';
case 'win32':
return 'Add-' + suffix.charAt(0).toUpperCase() + suffix.slice(1) + ' ';
return (
'Add-' +
suffix
.split('_')
.map((part: string) => part.charAt(0).toUpperCase() + part.slice(1))
.join('') +
' '
);
default:
return await log('Platform ' + os + ' is not supported', os, 'error');
}