Skip to content

Commit 68dbf01

Browse files
committed
#205: Filter away duplicates and windows backslash-starting paths
1 parent 328b0e0 commit 68dbf01

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/renderer/search_emme_pythonpath.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ const path = require('path');
22
const fs = require('fs');
33
const versions = require('../versions');
44
const os = require('os');
5+
const _ = require('lodash');
56

67
/**
78
* Check and try to set EMME's Python location on Windows, searching from common known paths.
@@ -140,7 +141,11 @@ function hasPythonEnv(basePath) {
140141
console.log(e);
141142
}
142143
}
143-
return exePaths;
144+
// Filter out duplicates
145+
const filteredPaths = _.uniq(exePaths).filter(filteredPath => {
146+
return !filteredPath.startsWith('\\');
147+
});
148+
return filteredPaths;
144149
}
145150

146151
module.exports = {

0 commit comments

Comments
 (0)