luhaowen 2 days ago
parent
commit
9c2874d119
1 changed files with 12 additions and 0 deletions
  1. 12 0
      vars/PrintMes.groovy

+ 12 - 0
vars/PrintMes.groovy

@@ -0,0 +1,12 @@
+// var/PrintMes.groovy 打印彩色字体方法
+def call(String value, String color) {
+    def colors = [
+        'red'    : "\033[40;31m >>>>>>>>>>>${value}<<<<<<<<<<< \033[0m",
+        'green'  : "\033[40;32m >>>>>>>>>>>${value}<<<<<<<<<<< \033[0m",
+        'purple' : "\033[40;35m >>>>>>>>>>>${value}<<<<<<<<<<< \033[0m",
+        'yellow' : "\033[40;33m >>>>>>>>>>>${value}<<<<<<<<<<< \033[0m"
+    ]
+    ansiColor('xterm') {
+        echo colors[color]
+    }
+}