Crystal library and CLI tool for Catbox.moe
修订版 | 9124e4d13bd9b689fa0d2bc6680373e54f38431e (tree) |
---|---|
时间 | 2021-11-08 18:17:33 |
作者 | Remilia Scarlet <remilia@post...> |
Commiter | Remilia Scarlet |
Check that files exist when uploading
@@ -87,7 +87,12 @@ | ||
87 | 87 | if RemiCatbox::URL_REGEX.match(file) |
88 | 88 | puts "Uploading #{file}..." |
89 | 89 | else |
90 | - puts "Uploading #{Path[file].basename}..." | |
90 | + if File.exists?(file) | |
91 | + puts "Uploading #{Path[file].basename}..." | |
92 | + else | |
93 | + RemiLog.log.error("File not found: #{file}") | |
94 | + next | |
95 | + end | |
91 | 96 | end |
92 | 97 | |
93 | 98 | # Do the actual upload |