ghost-node/scripts/header-prefixer.sh

17 lines
325 B
Bash
Raw Normal View History

#!/bin/sh
ROOT_PATH="${1:-}"
FILES=$(find ./"$ROOT_PATH" -type f -name '*.rs')
for f in $FILES; do
if (grep License $f); then
echo "[-] Already prefixed $f"
else
printf "\n" | cat file_header.txt - $f > $f.new
mv $f.new $f
echo "[+] License header copied to $f"
fi
done
echo "[+] All files have been processed"