MCPcopy Create free account
hub / github.com/REditorSupport/vscode-R / getRfromEnvPath

Function getRfromEnvPath

src/util.ts:44–61  ·  view source on GitHub ↗
(platform: string)

Source from the content-addressed store, hash-verified

42}
43
44function 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
63export async function getRpathFromSystem(): Promise<string> {
64

Callers 1

getRpathFromSystemFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected