diff options
Diffstat (limited to 'rhimport-dn')
-rwxr-xr-x | rhimport-dn | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/rhimport-dn b/rhimport-dn index ca7d4b2..dce71bc 100755 --- a/rhimport-dn +++ b/rhimport-dn @@ -126,20 +126,24 @@ for my $entry ($feed->entries) { print "\nPV: note added successfully"; print join('', <$reader>) . "\n"; } + print "\n"; } - print "\n"; } } -($file ne "") or die "No Entry found for today!\n"; -(-e "$file") or die "file '$file' not found - donwload error?\n"; +if($file eq "" || !(-e "$file")) { + print "No Entry found for today or download error - just clearing cart!\n"; + rhimport::check_key_file() or die "Import Key not found, use rhimport-create-id to create one\n"; + rhimport::clear_carts($dbh, $group, $to_cart); + exit 1; +} + print "will import $file to dropbox $dropbox (cart=$to_cart)\n\n"; my $error_cb = sub { my ($text) = @_; - print "\n$text .. cancel operation [Y/n]? "; - my $x = scalar(<STDIN>); - $x =~ /^n/i; + print "\n$text"; + return 0; }; rhimport::check_key_file() or die "Import Key not found, use rhimport-create-id to create one\n"; |