mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2024-12-20 13:33:07 +00:00
be7ce4110e
This reverts commit e96515433d
.
21 lines
535 B
Bash
Executable File
21 lines
535 B
Bash
Executable File
#! /bin/bash
|
|
#
|
|
# Reformat source code using clang-format.
|
|
#
|
|
# This script is not portable: as of Ubuntu 21.04, virtualenv's "activate"
|
|
# seems to rely on a non-POSIX variable, $OSTYPE.
|
|
|
|
set -C -u -e
|
|
|
|
# Reformat C++ files.
|
|
find -name \*.cxx -o -name \*.hxx | xargs clang-format -i
|
|
|
|
|
|
# Reformat CMake files.
|
|
WORKDIR=$(mktemp -d)
|
|
virtualenv -q --python=$(which python3) "$WORKDIR/venv"
|
|
. "$WORKDIR/venv/bin/activate"
|
|
pip install -q six pyaml cmake-format
|
|
(find -name CMakeLists.txt | xargs cmake-format -i) || /bin/true
|
|
rm -rf "$WORKDIR"
|