This patch optionally includes trashed items when importing from
1Password. I found this most useful when combined with my previous
patch to include Password (not just login) items.
--
John Franklin
[email protected]
commit 8d90c61405ac9f4081e1eb48806a955b08e3fc96
Author: John Franklin <[email protected]>
Date: Wed Sep 4 13:07:47 2019 -0400
Optionally include trashed items.
diff --git a/contrib/importers/1password2pass.rb b/contrib/importers/1password2pass.rb
index e0ca39b..51200da 100755
--- a/contrib/importers/1password2pass.rb
+++ b/contrib/importers/1password2pass.rb
@@ -25,6 +25,7 @@ options.force = false
options.name = :title
options.notes = true
options.meta = true
+options.trashed = false
optparse = OptionParser.new do |opts|
opts.banner = "Usage: #{opts.program_name}.rb [options] filename"
@@ -43,6 +44,9 @@ optparse = OptionParser.new do |opts|
"Import metadata and insert it below the password") do |meta|
options.meta = meta
end
+ opts.on("-t", "--[no-]trashed", "Include trashed items") do |trashed|
+ options.trashed = trashed
+ end
begin
opts.parse!
@@ -105,6 +109,7 @@ elsif File.extname(filename) =~ /.1pif/i
JSON.parse("[#{pif}]", symbolize_names: true).each do |entry|
next unless entry[:typeName] == "webforms.WebForm"
next if entry[:secureContents][:fields].nil?
+ next if entry[:trashed] && !options.trashed
pass = {}
_______________________________________________
Password-Store mailing list
[email protected]
https://lists.zx2c4.com/mailman/listinfo/password-store