lib/nakal/ios/screen.rb in nakal-0.0.3 vs lib/nakal/ios/screen.rb in nakal-0.0.4
- old
+ new
@@ -12,13 +12,13 @@
end tell
EOF'
def capture
`#{CAPTURE_SCRIPT}`
- sleep 0.5
+ sleep 1
+ Dir.glob(File.expand_path('~/Desktop/iOS\\ Simulator\\ Screen\\ Shot - Apple\\ Watch*')).each{|f| FileUtils.rm(f)}
latest_file = Dir.glob(File.expand_path('~/Desktop/iOS\\ Simulator\\ Screen\\ Shot*')).max_by { |f| File.mtime(f) }
- `mv #{Shellwords.shellescape(latest_file)} #{Nakal.image_location}`
- `mv #{Nakal.image_location}/iOS\\ Simulator\\ Screen\\ Shot* #{Nakal.image_location}/#{@name}.png`
+ File.rename(latest_file,"#{Nakal.image_location}/#{@name}.png")
end
end
end
end