We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7a3d3ba commit 0e1bc1aCopy full SHA for 0e1bc1a
2 files changed
lib/berkeley_library/sftp_handler/downloader/base.rb
@@ -41,6 +41,11 @@ def ssh_options
41
end
42
43
44
+ def assert_file_not_processed!(processed_path)
45
+ raise "File was already processed: #{processed_path}" \
46
+ if Pathname.new(processed_path).exist?
47
+ end
48
+
49
def assert_not_exists!(local_path)
50
raise "Local file already exists: #{local_path}" \
51
if Pathname.new(local_path).exist?
lib/berkeley_library/sftp_handler/downloader/lbnl.rb
@@ -15,6 +15,7 @@ def download!(filename: nil, local_dir: '/opt/app/data')
15
filename ||= default_filename
16
remote_path = Pathname.new(filename)
17
local_path = Pathname.new(local_dir) + filename
18
+ assert_file_not_processed! local_path + '.old'
19
assert_not_exists! local_path
20
21
connect do |sftp|
0 commit comments