rust-raspberrypi-OS-tutorials/utils/fmt_all.rb

18 lines
217 B
Ruby
Raw Normal View History

2018-04-13 20:07:30 +00:00
#!/usr/bin/env ruby
2018-12-29 23:20:24 +00:00
def fmt_all
crates = Dir["**/Cargo.toml"].sort!
2018-04-13 20:07:30 +00:00
2018-12-29 23:20:24 +00:00
crates.each do |x|
x = File.dirname(x)
2018-04-13 20:07:30 +00:00
2018-12-29 23:20:24 +00:00
Dir.chdir(x) do
system('cargo fmt')
end
2018-04-13 20:07:30 +00:00
end
end
2018-12-29 23:20:24 +00:00
if __FILE__ == $0
fmt_all()
end