Skip to content
This repository has been archived by the owner on Nov 21, 2019. It is now read-only.

Commit

Permalink
fix activeAdapter
Browse files Browse the repository at this point in the history
  • Loading branch information
icymind committed Sep 6, 2017
1 parent 79692f1 commit e0f95d5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/renderer/lib/win.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@ async function getActiveAdapterIndexAndName () {
const indexAndNamePattern = /^(\d+)\s*(.*)$/i // 注意不要添加 g 标志
headerIncludedIfs.split('\n').slice(1).forEach(line => {
const matchResult = indexAndNamePattern.exec(line.trim())
if (matchResult && !/virtualbox/ig.test(matchResult[2])) {
if (matchResult && !/(virtualbox|vmware)/ig.test(matchResult[2])) {
physicalIfs.push({
index: parseInt(matchResult[1].trim()),
infName: matchResult[2]
})
}
})
return physicalIfs[0]
return physicalIfs.sort((a, b) => a.index > b.index)[0]
}

async function getActiveAdapterIndex () {
Expand Down

0 comments on commit e0f95d5

Please sign in to comment.