Code

contrib/format.sh: Fix bashisms.
authorFlorian Forster <octo@collectd.org>
Sun, 29 Oct 2017 09:24:02 +0000 (10:24 +0100)
committerFlorian Forster <octo@collectd.org>
Sun, 29 Oct 2017 09:24:02 +0000 (10:24 +0100)
contrib/format.sh

index d4444cc28fc79d3ed7f57f31cd95ca83c4cd4e20..ea1ed0157ae7847ad58cd018cf2cd2983bc13c47 100755 (executable)
@@ -10,8 +10,8 @@ if test $# -lt 1; then
 fi
 
 for i in "$@"; do
-  d="$(dirname "${i}")"
-  o="$(tempfile -d "${d}" -m 0644)"
+  d="`dirname "${i}"`"
+  o="`TMPDIR="${d}" mktemp format.XXXXXX`"
 
   curl --silent --data-binary "@-" https://clang-format.appspot.com/ <"${i}" >"${o}"
   if test $? -eq 0; then