mirror of
https://github.com/rust-embedded/rust-raspberrypi-OS-tutorials.git
synced 2024-11-11 07:10:59 +00:00
26 lines
545 B
Ruby
Executable File
26 lines
545 B
Ruby
Executable File
#!/usr/bin/env ruby
|
|
# frozen_string_literal: true
|
|
|
|
require_relative '../utils/helpers/copyrighted'
|
|
|
|
puts "Warning, git pre-commit hooks temporarily disabled!"
|
|
exit
|
|
|
|
source_files_exts = ['.S', '.rs', '.rb']
|
|
|
|
staged_files = `git --no-pager diff --name-only --cached`.split(/\n/)
|
|
|
|
need_inspection = []
|
|
staged_files.each do |f|
|
|
puts f
|
|
need_inspection << f if
|
|
f.include?('Makefile') || source_files_exts.include?(File.extname(f))
|
|
end
|
|
|
|
error = false
|
|
need_inspection.each do |f|
|
|
error = true unless copyrighted?(f, true)
|
|
end
|
|
|
|
exit 1 if error
|