lib/astrails/safe/sftp.rb in astrails-safe-0.2.1 vs lib/astrails/safe/sftp.rb in astrails-safe-0.2.2
- old
+ new
@@ -41,12 +41,12 @@
def cleanup
return if $LOCAL || $DRY_RUN
return unless keep = @config[:keep, :sftp]
- puts "listing files in #{host}:#{path}" if $_VERBOSE
+ puts "listing files: #{host}:#{base}*" if $_VERBOSE
Net::SFTP.start(host, user, :password => password) do |sftp|
- files = sftp.dir.glob(path, '*')
+ files = sftp.dir.glob(path, File.basename("#{base}*"))
puts files.collect {|x| x.name } if $_VERBOSE
files = files.
collect {|x| x.name }.
\ No newline at end of file