Пример #1
0
        public static void PromptMerge()
        {
            Console.WriteLine("Give branch to merge to:");
            string mergeto = Console.ReadLine();

            Console.WriteLine("choose option:");
            UI.green();
            Console.WriteLine("(0) regular merge");
            Console.WriteLine("(1) squash merge");
            UI.white();
            string select = Console.ReadLine();
            bool   mergeT = false;//merge type-regular

            //using switch to allow conversion to int
            switch (Convert.ToInt32(select))
            {
            case 1:
                mergeT = true;
                break;

            default:
                mergeT = false;
                break;
            }
            Merge(mergeto, mergeT);
        }
Пример #2
0
        static int myOS = -1; //-1 don't know, 0 windows, 1 Linux, 2 OSx

        public static void PrintOS()
        {
            UI.white();
            Console.Write("Current OS: ");
            UI.yellow();
            Console.Write(RuntimeInformation.OSDescription);
            Console.Write(Environment.NewLine);
            UI.white();
        }
Пример #3
0
 public static void PrintLoadSuccess()
 {
     UI.white();
     Console.WriteLine("Load Sucess:");
     UI.cyan();
     Console.WriteLine(" Current Branch:  " + curBranchN);
     Console.Write(" Current Remotes: ");
     Console.Write(getRemotesString(true));
     Console.WriteLine();
     UI.white();
 }
Пример #4
0
        public static void WriteVersion()
        {
            UI.white();
            Console.Write("Current Version: ");
            UI.yellow();
            string stringval = curVers.ToStr();

            Console.Write(stringval);
            Console.Write(Environment.NewLine);
            UI.white();
        }
Пример #5
0
 public static void PrintSettings()
 {
     UI.white();
     Console.WriteLine("Current ignore settings:");
     UI.cyan();
     for (int i = 0; i < filetypes.Length; i++)
     {
         Console.WriteLine(" " + filetypes[i]);
     }
     UI.white();
 }
Пример #6
0
 private static void printIndexes(string msg, string[] options)
 {
     Console.WriteLine(msg);
     UI.green();
     for (int i = 0; i < options.Length; i++)
     {
         Console.WriteLine(options[i] + "(" + i.ToString() + ")");
     }
     UI.white();
     Console.WriteLine();
 }
Пример #7
0
        public static bool GitIgnorecheck()
        {
            bool output = File.Exists(ignorepath);

            if (!output)
            {
                UI.yellow();
                Console.WriteLine("Warning no gitignore found, create one? (y/n)");
                string resp = Console.ReadLine();
                UI.white();
                if (resp == "y")
                {
                    GenerateGitIgnore(GetIgnoreRules());
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            return(true);
        }
Пример #8
0
        static void Main(string[] args)
        {
            //version info print
            VersionController.WriteVersion();
            //find out OS
            OS.IdentifyOS();
            OS.PrintOS();
            UI.blank(1);

            //now check if there is an init folder
            git.IsInit();

            while (true)
            {
                bool workedReading = Settings.Read();
                //Settings.ChangeCurBranch("thisbranch");//can change branch like this
                if (!workedReading)
                {
                    UI.red();
                    Console.WriteLine("Couldn't read config file in:");
                    Console.WriteLine(" " + Settings.configFN);
                    Console.WriteLine("aborting...");
                    UI.white();
                    //give offer to return default file
                }
                else
                {
                    Console.WriteLine();
                    //now ask about pushing
                    Console.WriteLine("give commit message for auto push or enter a setting");
                    Console.WriteLine("Settings are:");
                    UI.green();
                    Console.WriteLine("(b)    create/checkout branch from current and be pushing to this");
                    Console.WriteLine("(r)    change remote to commit on");
                    Console.WriteLine("(ar)   add remote to commit on");
                    Console.WriteLine("(rr)   remove remote to commit on");
                    Console.WriteLine("(m)    merge current branch to another");
                    Console.WriteLine("(cmd)  pure cmd input");
                    Console.WriteLine("(l)    see license info");
                    Console.WriteLine("(help) help!");
                    Console.WriteLine("(q)    quit program");
                    UI.white();

                    string resp = Console.ReadLine();
                    if (resp == "r")
                    {
                        Settings.PromptChangeRemote();
                    }
                    else if (resp == "ar")
                    {
                        Settings.PromptAddRemote();
                    }
                    else if (resp == "rr")
                    {
                        Settings.RemoveRemote();
                    }
                    else if (resp == "b")
                    {
                        Settings.PromptCheckoutNB();
                    }
                    else if (resp == "m")
                    {
                        git.PromptMerge();
                    }
                    else if (resp == "cmd")
                    {
                        Console.WriteLine("Give command for cmd to run");
                        string[] cmds = new string[1];
                        cmds[0] = Console.ReadLine();
                        string[] lineoutput = CMD.CMDcmdsLines(cmds, true);
                    }
                    else if (resp == "l")
                    {
                        Licence.DisplayScreen();
                    }
                    else if (resp == "help")
                    {
                        DisplayHelp();
                    }
                    else if (resp == "q")
                    {
                        ExitPrint();
                        break;
                    }
                    else
                    {
                        git.PushAll(resp);
                    }
                }
                Console.WriteLine();
            }
            //all done either reloop or quit
        }
Пример #9
0
 public static void giveWarning(string msg)
 {
     UI.yellow();
     Console.WriteLine("WARNING: " + msg);
     UI.white();
 }