Fix WSL Check to work if we dont know if we are running under linux yet
This commit is contained in:
Родитель
7d1e542b91
Коммит
ffd97360ec
|
@ -77,10 +77,20 @@ export class CommandExecutor extends ICommandExecutor
|
|||
{
|
||||
// See https://github.com/microsoft/WSL/issues/4071 for evidence that we can rely on this behavior.
|
||||
|
||||
if(os.platform() !== 'linux')
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
const command = 'grep';
|
||||
const args = ['-i', 'Microsoft', '/proc/version'];
|
||||
const commandResult = proc.spawnSync(command, args);
|
||||
|
||||
if(!commandResult || !commandResult.stdout)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return commandResult.stdout.toString() !== '';
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче