(platform: string)
| 42 | } |
| 43 | |
| 44 | function getRfromEnvPath(platform: string) { |
| 45 | let splitChar = ':'; |
| 46 | let fileExtension = ''; |
| 47 | |
| 48 | if (platform === 'win32') { |
| 49 | splitChar = ';'; |
| 50 | fileExtension = '.exe'; |
| 51 | } |
| 52 | |
| 53 | const os_paths: string[] | string = process.env.PATH ? process.env.PATH.split(splitChar) : []; |
| 54 | for (const os_path of os_paths) { |
| 55 | const os_r_path: string = path.join(os_path, 'R' + fileExtension); |
| 56 | if (fs.existsSync(os_r_path)) { |
| 57 | return os_r_path; |
| 58 | } |
| 59 | } |
| 60 | return ''; |
| 61 | } |
| 62 | |
| 63 | export async function getRpathFromSystem(): Promise<string> { |
| 64 |
no outgoing calls
no test coverage detected