1#!/usr/bin/env bash
2
3# Copyright 2016 The Fuchsia Authors
4#
5# Use of this source code is governed by a MIT-style
6# license that can be found in the LICENSE file or at
7# https://opensource.org/licenses/MIT
8
9SCRIPTSDIR=`dirname $0`
10CLANGFMT=$SCRIPTSDIR/clang-format
11
12if [ ! -f "$CLANGFMT" ]; then
13  echo "local clang-format not found. Running scripts/fetch-clang-fmt to get it."
14  ( cd $SCRIPTSDIR && ./fetch-clang-fmt )
15fi
16
17if [ ! -f $CLANGFMT ]; then
18  echo "$CLANGFMT still not found. Exiting."
19  exit 0
20fi
21
22$CLANGFMT -i -style=file $@
23