Ejemplo n.º 1
0
 static void printGitMergeState()
 {
     if (repo.isInMerge)
     {
         string mergeSymbol = UnicodeSymbols.getString(UnicodeSymbols.SYMBOL.MERGE);
         BashColor.print(" " + mergeSymbol + " MERGE ", BashColor.COLOR.BLACK, BashColor.COLOR.ORANGE);
     }
 }
Ejemplo n.º 2
0
 static void printGitVirginState()
 {
     if (!repo.hasModifiedFiles &&
         !repo.hasStagedFiles &&
         !repo.hasUntrackedFilesNotIgnored &&
         !repo.hasUntrackedIgnored)
     {
         string loveSymbol = UnicodeSymbols.getString(UnicodeSymbols.SYMBOL.HEART);
         BashColor.print(" " + loveSymbol, BashColor.COLOR.RED, BashColor.COLOR.TRANSPARENT);
     }
 }
Ejemplo n.º 3
0
        static void printPromptSymbol(string lastCommandState)
        {
            BashColor.COLOR promptColor = BashColor.COLOR.PINK;

            if (lastCommandState != "0")
            {
                promptColor = BashColor.COLOR.RED;
            }

            string promptSymbol = UnicodeSymbols.getString(UnicodeSymbols.SYMBOL.TRIANGLE_RIGHT);

            BashColor.print(" " + promptSymbol + " ", promptColor, BashColor.COLOR.TRANSPARENT);
        }
Ejemplo n.º 4
0
 static void printGitFilesInfos()
 {
     if (repo.hasModifiedFiles)
     {
         string modSymbol = UnicodeSymbols.getString(UnicodeSymbols.SYMBOL.PENCIL);
         BashColor.print(" " + modSymbol + " ", BashColor.COLOR.YELLOW, BashColor.COLOR.GREY_DARK);
     }
     if (repo.hasUntrackedFilesNotIgnored)
     {
         string untrackedSymbol = UnicodeSymbols.getString(UnicodeSymbols.SYMBOL.PLUS);
         BashColor.print(" " + untrackedSymbol + " ", BashColor.COLOR.YELLOW, BashColor.COLOR.GREY_DARK);
     }
     if (repo.hasStagedFiles)
     {
         string stagedSymbol = UnicodeSymbols.getString(UnicodeSymbols.SYMBOL.FLAG);
         BashColor.print(" " + stagedSymbol + " ", BashColor.COLOR.GREEN, BashColor.COLOR.GREY_DARK);
     }
 }
Ejemplo n.º 5
0
        static void printGitBranchInfos()
        {
            if (repo.isDetachedHead)
            {
                string anchorSymbol = UnicodeSymbols.getString(UnicodeSymbols.SYMBOL.ANCHOR);
                BashColor.print(" " + anchorSymbol + " " + repo.commitID + " ", BashColor.COLOR.BLACK, BashColor.COLOR.ORANGE);

                if (repo.hasModifiedFiles ||
                    repo.hasStagedFiles)
                {
                    string dangerSymbol = UnicodeSymbols.getString(UnicodeSymbols.SYMBOL.LIGHTNING);
                    BashColor.print(" " + dangerSymbol + " DANGER " + dangerSymbol + " ", BashColor.COLOR.BLACK, BashColor.COLOR.RED, true);
                }
            }
            else
            {
                BashColor.COLOR branchBGColor   = BashColor.COLOR.BLACK;
                string          branchPreSymbol = " ";
                if (repo.hasModifiedFiles ||
                    repo.hasStagedFiles ||
                    repo.hasUntrackedFilesNotIgnored)
                {
                    branchBGColor = BashColor.COLOR.YELLOW;
                }

                if (!repo.hasModifiedFiles &&
                    !repo.hasStagedFiles &&
                    !repo.hasUntrackedFilesNotIgnored)
                {
                    branchPreSymbol = " " + UnicodeSymbols.getString(UnicodeSymbols.SYMBOL.SUN) + " ";
                    branchBGColor   = BashColor.COLOR.GREEN;
                }
                else
                {
                    branchPreSymbol = " " + UnicodeSymbols.getString(UnicodeSymbols.SYMBOL.DELTA) + " ";
                }
                BashColor.print(branchPreSymbol + repo.branch + " ", BashColor.COLOR.BLACK, branchBGColor);
            }
        }
Ejemplo n.º 6
0
        static void printGitRemoteInfos()
        {
            if (!repo.branchHasUpstream)
            {
                string udArrow = UnicodeSymbols.getString(UnicodeSymbols.SYMBOL.ARROW_UP_DOWN);
                BashColor.print(" " + udArrow + "? ", BashColor.COLOR.RED, BashColor.COLOR.GREY_DARK);
                return;
            }

            if (repo.isAhead)
            {
                string uArrow = UnicodeSymbols.getString(UnicodeSymbols.SYMBOL.ARROW_UP);
                string cAhead = repo.commitsAhead.ToString();
                string space  = " ";
                if (repo.isBehind)
                {
                    space = "";
                }
                BashColor.print(" " + uArrow + cAhead + space, BashColor.COLOR.GREEN, BashColor.COLOR.GREY_DARK);
            }

            if (repo.isAhead && repo.isBehind)
            {
                string warningSymbol = UnicodeSymbols.getString(UnicodeSymbols.SYMBOL.LIGHTNING);
                BashColor.print(warningSymbol, BashColor.COLOR.YELLOW, BashColor.COLOR.GREY_DARK);
            }

            if (repo.isBehind)
            {
                string dArrow  = UnicodeSymbols.getString(UnicodeSymbols.SYMBOL.ARROW_DOWN);
                string cBehind = repo.commitsBehind.ToString();
                string space   = " ";
                if (repo.isAhead)
                {
                    space = "";
                }
                BashColor.print(space + cBehind + dArrow + " ", BashColor.COLOR.RED, BashColor.COLOR.GREY_DARK);
            }
        }