Пример #1
0
        private void SetWorkingDirectory(PipeLaunchOptions options, string path, string workingDir)
        {
            string rustInstallPath = env.GetRustInstallPath();

            if (String.IsNullOrWhiteSpace(workingDir))
            {
                options.WorkingDirectory = EscapePath(Path.GetDirectoryName(path));
                if (rustInstallPath != null)
                {
                    options.AdditionalSOLibSearchPath = rustInstallPath;
                }
            }
            else
            {
                options.WorkingDirectory = EscapePath(workingDir);
                // GDB won't search working directory by default, but this is expected on Windows.
                string additionalPath;
                if (rustInstallPath != null)
                {
                    additionalPath = rustInstallPath + ";" + workingDir;
                }
                else
                {
                    additionalPath = workingDir;
                }
                options.AdditionalSOLibSearchPath = additionalPath;
            }
        }
Пример #2
0
        void InjectRustBinPath(ProcessStartInfo startInfo)
        {
            string installPath = env.GetRustInstallPath();

            if (installPath == null)
            {
                return;
            }
            string envPath    = Environment.GetEnvironmentVariable("PATH");
            string newEnvPath = String.Format("{0};{1}", envPath, installPath);

            startInfo.EnvironmentVariables["PATH"] = newEnvPath;
        }