File: format.sh

package info (click to toggle)
ftxui 5.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,084 kB
  • sloc: cpp: 23,669; xml: 211; sh: 25; javascript: 20; python: 16; makefile: 15
file content (19 lines) | stat: -rwxr-xr-x 355 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/bash
cd "$(dirname "$0")"
cd ..

# Add the license file.
files=$(find ./src ./include ./examples  -name "*.hpp" -o -name "*.cpp")
for file in $files
do
  if ! grep -q Copyright $file
  then
    cat ./tools/license_headers.cpp $file > $file.new && mv $file.new $file
  fi
done

# Use clang-format.
for file in $files
do
  clang-format -i $file
done