@@ -78,7 +78,6 @@ const listEMMEPythonPaths = () => {
78
78
)
79
79
} )
80
80
paths . push ( `usr/bin/python${ pythonVersion . major } ` ) ; // mainly for developers on Mac & Linux
81
- paths . push ( 'users/erkki/testi' ) ;
82
81
83
82
const allPathCombinations = drives . reduce (
84
83
( accumulator , d ) => {
@@ -117,31 +116,24 @@ function hasPythonEnv(basePath) {
117
116
if ( pathExists ) {
118
117
try {
119
118
const subPaths = fs . readdirSync ( basePath )
120
- console . log ( subPaths ) ;
121
119
subPaths . forEach ( subPath => {
122
- if ( subPath . startsWith ( "Emme " ) ) {
123
- const majorVersionFolderPath = path . join ( basePath , subPath ) ;
124
- const majorVersionFolderPathFiles = fs . readdirSync ( majorVersionFolderPath ) ;
120
+ if ( subPath . startsWith ( "Emme" ) ) {
121
+ const emmeVersionFolder = path . join ( basePath , subPath ) ;
122
+ const emmeVersionFolderContents = fs . readdirSync ( emmeVersionFolder ) ;
125
123
126
- console . log ( majorVersionFolderPathFiles ) ;
124
+ console . log ( emmeVersionFolderPathFiles ) ;
125
+ console . log ( emmeVersionFolderContents ) ;
127
126
128
- // Filter away every folder except possible Emme installation folders
129
- const subVersionFolders = majorVersionFolderPathFiles . filter ( file => file . startsWith ( "Emme-" ) ) ;
130
- subVersionFolders . forEach ( subVersionFolder => {
131
- // Go through the subdirectory and look for a python executable, should be in Emme-x.xx.xx.xx/Python/python.exe on Windows machines.
132
- const emmeFolderFilesPath = path . join ( majorVersionFolderPath , subVersionFolder ) ;
133
- const emmeFolderFiles = fs . readdirSync ( emmeFolderFilesPath ) ;
134
- emmeFolderFiles . forEach ( emmeFolderPath => {
135
- if ( emmeFolderPath . startsWith ( "Python" ) ) {
136
- const pythonFolderPath = path . join ( emmeFolderFilesPath , emmeFolderPath ) ;
137
- const pythonPathFiles = fs . readdirSync ( pythonFolderPath ) ;
138
- pythonPathFiles . forEach ( fileName => {
139
- if ( fileName === 'python.exe' ) {
140
- exePaths . push ( path . join ( pythonFolderPath , fileName ) ) ;
141
- }
142
- } )
143
- }
144
- } )
127
+ emmeVersionFolderContents . forEach ( emmeFolderPath => {
128
+ if ( emmeFolderPath . startsWith ( "Python" ) ) {
129
+ const pythonFolderPath = path . join ( emmeVersionFolder , emmeFolderPath ) ;
130
+ const pythonPathFiles = fs . readdirSync ( pythonFolderPath ) ;
131
+ pythonPathFiles . forEach ( fileName => {
132
+ if ( fileName === 'python.exe' ) {
133
+ exePaths . push ( path . join ( pythonFolderPath , fileName ) ) ;
134
+ }
135
+ } )
136
+ }
145
137
} )
146
138
}
147
139
} )
0 commit comments