()
| 6 | import { EventEmitter } from 'events'; |
| 7 | |
| 8 | function get_ST_DIR() { |
| 9 | switch (os.platform()) { |
| 10 | case 'win32': |
| 11 | return 'C:\\ST'; |
| 12 | case 'darwin': |
| 13 | return '/Applications/STM32CubeIDE.app/Contents/Eclipse'; |
| 14 | default: |
| 15 | const dirName = (process.env.HOME || os.homedir()) + '/st'; |
| 16 | return fs.existsSync(dirName) ? dirName : '/opt/st'; |
| 17 | } |
| 18 | } |
| 19 | |
| 20 | // Path of the top-level STM32CubeIDE installation directory, os-dependant |
| 21 | const ST_DIR = get_ST_DIR(); |