瀏覽代碼

misc/qubes-run-gnome-terminal: avoid external utility (grep)

Shave off a few milliseconds.
Rusty Bird 4 年之前
父節點
當前提交
9d9ef25b05
共有 1 個文件被更改,包括 4 次插入5 次删除
  1. 4 5
      misc/qubes-run-gnome-terminal

+ 4 - 5
misc/qubes-run-gnome-terminal

@@ -5,8 +5,7 @@
 # Check if our gnome-terminal version supports --wait
 # (we can't just run it and check exit code, because if it works, it will
 # return the exit code of the child process)
-if gnome-terminal --help-terminal-options | grep --silent -- --wait; then
-    exec gnome-terminal --wait "$@"
-else
-    exec gnome-terminal "$@"
-fi
+case "$(gnome-terminal --help-terminal-options)" in
+    *--wait*) exec gnome-terminal --wait "$@" ;;
+    *)        exec gnome-terminal "$@" ;;
+esac