Run cargo fmt in parallel

pull/110/head
Andre Richter 3 years ago
parent c0da8ab1b7
commit fd30d911d8
No known key found for this signature in database
GPG Key ID: 2116C1AB102F615E

@ -42,10 +42,6 @@ class TutorialCrate
end
def fmt_cargo_rust(args)
print 'Rust cargo fmt '.light_blue
print "#{args} ".light_blue unless args.nil?
puts @folder
Dir.chdir(@folder) { exit(1) unless system("cargo fmt #{args}") }
end
@ -216,7 +212,14 @@ class DevTool
def fmt_cargo_rust(check: false)
args = '-- --check' if check
@crates.each { |c| c.fmt_cargo_rust(args) }
@crates.each do |c|
print 'Rust cargo fmt '.light_blue
print "#{args} ".light_blue unless args.nil?
puts c.folder
Process.fork { c.fmt_cargo_rust(args) }
end
Process.waitall
end
def fmt_prettier(check: false)

Loading…
Cancel
Save