Skip to content

Commit

Permalink
wmic is deprecated, use powershell to find out the version of android…
Browse files Browse the repository at this point in the history
  • Loading branch information
asklar authored Nov 22, 2021
1 parent ca23039 commit cddb0c3
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ export default {
'bin',
'studio.exe',
).replace(/\\/g, '\\\\');
const powershell = `${process.env.SystemRoot}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`;
const {stdout} = await executeCommand(
`wmic datafile where name="${androidStudioPath}" get Version`,
`${powershell} -Command "& { (Get-ChildItem \\"${androidStudioPath}\\").VersionInfo.FileVersionRaw.ToString() }"`,
);
const version = stdout.replace(/(\r\n|\n|\r)/gm, '').trim();

Expand Down

0 comments on commit cddb0c3

Please sign in to comment.