Ejemplo n.º 1
0
        private async Task <string> GetRemoteRtvsPackagePath(IRExpressionEvaluator eval)
        {
            var isWindows = await eval.IsRSessionPlatformWindowsAsync();

            if (!isWindows)
            {
                // Remote Linux
                return("/usr/share/rtvs");
            }
            // Check if there is 'rtvs' folder on remote
            var rtvsExists = await eval.FileExistsAsync("./rtvs/NAMESPACE");

            if (rtvsExists)
            {
                return(".");
            }
            // Most probably tests are running remote broker locally
            var locator       = BrokerExecutableLocator.Create(_fileSystem);
            var hostDirectory = Path.GetDirectoryName(locator.GetHostExecutablePath());

            rtvsExists = _fileSystem.FileExists(Path.Combine(hostDirectory, @"rtvs\NAMESPACE"));
            return(rtvsExists ? hostDirectory : Path.GetFullPath(Path.Combine(hostDirectory, @"..\..")));
        }