Repository for GregTech 6
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

update_license_header.sh 413B

1234567891011121314151617181920
  1. #!/bin/sh
  2. SOURCE_DIR=`dirname $0`
  3. [ -z "$LICENSE_HEADER" ] && export LICENSE_HEADER="$(cat "$SOURCE_DIR/LICENSE.header")"
  4. ORIGINAL_HEADER="$(sed '/^package/Q' "$1")"
  5. if [ "$LICENSE_HEADER" = "$ORIGINAL_HEADER" ]; then
  6. echo "Already has header: $1"
  7. exit 0
  8. fi
  9. echo "Adding header to: $1"
  10. cp "$SOURCE_DIR/LICENSE.header" "$1.tmp"
  11. echo "" >> "$1.tmp"
  12. awk '/^package/{i++}i' "$1" >> "$1.tmp"
  13. mv "$1.tmp" "$1"