mirror of
https://github.com/Sani7/remote-ui.git
synced 2026-10-27 06:01:14 +01:00
21 lines
433 B
Bash
21 lines
433 B
Bash
#!/bin/bash
|
|
for arg in "$@"; do
|
|
if [[ "$arg" == "-g" ]]; then
|
|
commit=true
|
|
# Put your command here
|
|
fi
|
|
done
|
|
|
|
if [ "$commit" == true ]; then
|
|
# save unsaved work
|
|
git stash --include-untracked
|
|
fi
|
|
|
|
|
|
find . -type f -regex '.*/.*\.\(c\|cpp\|h\|hpp\)$' -not -path "./external/*" -not -path "./build/*" -exec clang-format -i {} \;
|
|
|
|
if [ "$commit" == true ]; then
|
|
git add -A && git commit -m "Lint"
|
|
git stash pop
|
|
fi
|