From 736cb27d3ab7c5e787a937e9f542ccacce02281f Mon Sep 17 00:00:00 2001 From: Rongli Sun Date: Fri, 20 Mar 2020 13:24:03 +0800 Subject: [PATCH] [script] let alias to take effect (#4708) --- script/clang-format | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/script/clang-format b/script/clang-format index 1266d85b5..f9eca196c 100755 --- a/script/clang-format +++ b/script/clang-format @@ -34,6 +34,10 @@ die() { exit 1 } +# Aliases are not expanded when the shell is not interactive, unless the +# expand_aliases shell option is set using shopt. +shopt -s expand_aliases + if command -v clang-format-6.0 > /dev/null; then alias clang-format=clang-format-6.0 elif command -v clang-format > /dev/null; then