Beispiel #1
0
        /// <summary>
        /// Call VSCode with arguments
        /// </summary>
        static void CallVSCode(string args)
        {
            System.Diagnostics.Process proc = new System.Diagnostics.Process();
            if (!VSCodeExists(CodePath))
            {
                PrintNotFound(CodePath);
                return;
            }
#if UNITY_EDITOR_OSX
            proc.StartInfo.FileName = "open";
            // Check the path to see if there is "Insiders"
            if (CodePath.Contains("Insiders"))
            {
                proc.StartInfo.Arguments = " -n -b \"com.microsoft.VSCodeInsiders\" --args " + args.Replace(@"\", @"\\");
            }
            else
            {
                proc.StartInfo.Arguments = " -n -b \"com.microsoft.VSCode\" --args " + args.Replace(@"\", @"\\");
            }
            proc.StartInfo.UseShellExecute = false;
#elif UNITY_EDITOR_WIN
            proc.StartInfo.FileName        = CodePath;
            proc.StartInfo.Arguments       = args;
            proc.StartInfo.UseShellExecute = false;
#else
            proc.StartInfo.FileName        = CodePath;
            proc.StartInfo.Arguments       = args.Replace(@"\", @"\\");
            proc.StartInfo.UseShellExecute = false;
#endif
            proc.StartInfo.WindowStyle            = System.Diagnostics.ProcessWindowStyle.Hidden;
            proc.StartInfo.CreateNoWindow         = true;
            proc.StartInfo.RedirectStandardOutput = true;
            proc.Start();
        }