Skip to content

Instantly share code, notes, and snippets.

@kiarina
Created October 5, 2015 23:04
Show Gist options
  • Save kiarina/a1145b153e81dec0b6c1 to your computer and use it in GitHub Desktop.
Save kiarina/a1145b153e81dec0b6c1 to your computer and use it in GitHub Desktop.
format script.
#!/bin/sh
cd `dirname $0`
if [ `uname` = "Darwin" ]; then
for target in `find ../Classes -name "*.cpp" -or -name "*.h"`
do
echo 'format '${target}
# nkf --overwrite -w8 -Lu ${target}
clang-format -i ${target}
done
else
find ../Classes/ -name "*.cpp" -or -name "*.h" | xargs -P 4 -I@ bash -c "echo 'processing '@; nkf --overwrite -w8 -Lu @; clang-format -i @;"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment