15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
# File 'snapshot/lib/snapshot/screenshot_rotate.rb', line 15
def rotate(path)
Dir.glob([path, '/**/*.png'].join('/')).each do |file|
UI.verbose("Rotating '#{file}'")
command = nil
if file.end_with?("landscapeleft.png")
command = "sips -r -90 '#{file}'"
elsif file.end_with?("landscaperight.png")
command = "sips -r 90 '#{file}'"
elsif file.end_with?("portrait_upsidedown.png")
command = "sips -r 180 '#{file}'"
end
next unless command
FastlaneCore::FastlanePty.spawn(command) do |command_stdout, command_stdin, pid|
command_stdout.sync
command_stdout.each do |line|
end
::Process.wait(pid)
end
end
end
|