Beispiel #1
0
        /***********************************************************************/
        // Create Upgrade Package Section
        /***********************************************************************/
        /// <summary>
        /// Run the batch file to update TFS with latest.
        /// </summary>
        static void UpdateGit()
        {
            Console.WriteLine("Get the latest code from git.exe.");
            XmlClass xClass = new XmlClass();
            xClass.ReadFile();

            ProcessStartInfo pInfo = new ProcessStartInfo();
            pInfo.FileName = xClass.XmlValues["GitLocation"];
            pInfo.Arguments = "pull";
            pInfo.WorkingDirectory = xClass.XmlValues["RepoLocation"];

            pInfo.UseShellExecute = false;
            pInfo.CreateNoWindow = true;
            pInfo.RedirectStandardError = true;
            pInfo.RedirectStandardOutput = true;

            Process p = new Process();
            p.StartInfo = pInfo;
            p.OutputDataReceived += new DataReceivedEventHandler(Display);
            p.ErrorDataReceived += new DataReceivedEventHandler(Display);
            p.Start();
            p.BeginOutputReadLine();
            p.BeginErrorReadLine();

            p.WaitForExit();
        }
        /// <summary>
        /// Get the code lynx folder paths and store them.
        /// </summary>
        /// <returns></returns>
        public List<string> GetCodeLynxFolders()
        {
            try
            {
                // Get Location //
                XmlClass xClass = new XmlClass();
                xClass.ReadFile();
                string baseFolder = xClass.XmlValues["StartLocation"];

                // Count number of schemas //
                List<string> lynxFolderHold = new List<string>();
                string folderPath = baseFolder + "\\20_Code";
                string[] dir = Directory.GetDirectories(folderPath);
                foreach (string s in dir)
                {
                    if (s.IndexOf("lynx", StringComparison.OrdinalIgnoreCase) != -1)
                        lynxFolderHold.Add(s);
                }

                return lynxFolderHold;
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                return null;
            }
        }
Beispiel #3
0
        /// <summary>
        /// Get the locations from the xml file.
        /// </summary>
        static void GetLocations()
        {
            XmlClass xClass = new XmlClass();
            xClass.ReadFile();
            StartLocation = xClass.XmlValues["StartLocation"];
            OracleLocation = xClass.XmlValues["OracleLocation"];

            using (var sr = new StreamReader(StartLocation + "\\Current Edition.txt"))
            {
                CurrentEdition = sr.ReadLine();
                NextEdition = sr.ReadLine();
            }
        }
        /// <summary>
        /// Get the structure lynx folder paths and store them.
        /// </summary>
        /// <returns></returns>
        public List<string> GetStructureLynxFolders()
        {
            try
            {
                // Get Location //
                XmlClass xClass = new XmlClass();
                xClass.ReadFile();
                string baseFolder = xClass.XmlValues["StartLocation"];

                // Get the current and next Edition //
                using (var sr = new StreamReader(baseFolder + "\\Current Edition.txt"))
                {
                    currentEdition = sr.ReadLine();
                    nextEdition = sr.ReadLine();
                }

                // Count number of schemas //
                List<string> lynxFolderHold = new List<string>();
                string folderPath = baseFolder + "\\10_Structure\\" + currentEdition;
                string[] dir = Directory.GetDirectories(folderPath);
                foreach (string s in dir)
                {
                    if (s.IndexOf("lynx", StringComparison.OrdinalIgnoreCase) != -1)
                        lynxFolderHold.Add(s);
                }

                return lynxFolderHold;
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                return null;
            }
        }