@@ -98,9 +98,16 @@ export async function isIdfSetupValid(
98
98
const missingTools = failedToolsResult . map ( ( t ) => t . name ) . join ( ", " ) ;
99
99
return [ false , `Missing required tools: ${ missingTools } ` ] ;
100
100
}
101
- const pyEnvReqs = await checkPyVenv ( venvPythonPath , envVars [ "IDF_PATH" ] ) ;
102
- if ( ! pyEnvReqs ) {
103
- return [ false , "Python virtual environment or requirements are not satisfied" ] ;
101
+ const [ pyEnvReqsValid , pyEnvReqsMsg ] = await checkPyVenv (
102
+ venvPythonPath ,
103
+ envVars [ "IDF_PATH" ]
104
+ ) ;
105
+ if ( ! pyEnvReqsValid ) {
106
+ return [
107
+ pyEnvReqsValid ,
108
+ pyEnvReqsMsg ||
109
+ "Python virtual environment or requirements are not satisfied" ,
110
+ ] ;
104
111
}
105
112
return [ true , "" ] ;
106
113
} catch ( error ) {
@@ -113,7 +120,10 @@ export async function isIdfSetupValid(
113
120
}
114
121
}
115
122
116
- export async function checkPyVenv ( pyVenvPath : string , espIdfPath : string ) {
123
+ export async function checkPyVenv (
124
+ pyVenvPath : string ,
125
+ espIdfPath : string
126
+ ) : Promise < [ boolean , string ] > {
117
127
const pyExists = await pathExists ( pyVenvPath ) ;
118
128
if ( ! pyExists ) {
119
129
return [ false , `${ pyVenvPath } does not exist.` ] ;
@@ -130,7 +140,7 @@ export async function checkPyVenv(pyVenvPath: string, espIdfPath: string) {
130
140
requirements = join ( espIdfPath , "requirements.txt" ) ;
131
141
const requirementsExists = await pathExists ( requirements ) ;
132
142
if ( ! requirementsExists ) {
133
- return false ;
143
+ return [ false , ` ${ requirements } doesn't exist.` ] ;
134
144
}
135
145
}
136
146
const reqsResults = await startPythonReqsProcess (
0 commit comments