* Determines the correct python command to use * @returns {string} 'python3' or 'python'
()
| 7 | * @returns {string} 'python3' or 'python' |
| 8 | */ |
| 9 | function getPythonCommand() { |
| 10 | try { |
| 11 | // Prefer python3 if available |
| 12 | execSync('command -v python3', { stdio: 'ignore' }); |
| 13 | return 'python3'; |
| 14 | } catch (e) { |
| 15 | // Fallback to python |
| 16 | try { |
| 17 | execSync('command -v python', { stdio: 'ignore' }); |
| 18 | return 'python'; |
| 19 | } catch (error) { |
| 20 | throw new Error('Neither python3 nor python command is available in the PATH'); |
| 21 | } |
| 22 | } |
| 23 | } |
| 24 | |
| 25 | |
| 26 | /** |