Permalink
Browse files

Fix dbshots not checking that the target directory exists before movi…

…ng files to it.
  • Loading branch information...
1 parent f50b6fa commit 47e7f1c406feef642f1cde8d4ce775f2c578956a @SaberUK committed Nov 1, 2012
Showing with 1 addition and 0 deletions.
  1. +1 −0 bin/dbshots
View
@@ -9,6 +9,7 @@ require 'fileutils'
links = []
target_base = File.expand_path('~/Dropbox/Public')
target_route = Date.today.strftime('%Y/%B')
+Dir.mkdir("#{target_base}/#{target_route}") unless File.directory?("#{target_base}/#{target_route}")
Dir.glob("#{ENV['HOME']}/Desktop/Screen*.png").each do |screenshot|
FileUtils.move(screenshot, "#{target_base}/#{target_route}")
links << "https://dl.dropbox.com/u/14234621/#{target_route}/#{File.basename(screenshot).gsub(' ', '%20')}"

0 comments on commit 47e7f1c

Please sign in to comment.