password-store

Simple password manager using gpg and ordinary unix directories
git clone https://git.zx2c4.com/password-store
Log | Files | Refs | README | LICENSE

commit 18f36f05367f78820632870bff09bf80685d115b
parent 4690a3021cf74b2093d296f48f205b6706f82f2a
Author: Raphaƫl Droz <raphael.droz@gmail.com>
Date:   Mon, 11 May 2015 13:38:58 +0200

lastpass importer: more types supported and better checking

Diffstat:
Mcontrib/importers/lastpass2pass.rb | 10+++++++---
1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/contrib/importers/lastpass2pass.rb b/contrib/importers/lastpass2pass.rb @@ -76,7 +76,7 @@ entry = "" begin file = File.open(filename) file.each do |line| - if line =~ /^http/ + if line =~ /^(http|ftp|ssh)/ entries.push(entry) entry = "" end @@ -110,8 +110,12 @@ puts "Records parsed: #{records.length}" successful = 0 errors = [] records.each do |r| + if File.exist?("#{r.name}.gpg") and FORCE == false + puts "skipped #{r.name}: already exists" + next + end print "Creating record #{r.name}..." - IO.popen("pass insert -m#{"f" if FORCE} '#{r.name}' > /dev/null", 'w') do |io| + IO.popen("pass insert -m '#{r.name}' > /dev/null", 'w') do |io| io.puts r end if $? == 0 @@ -124,7 +128,7 @@ records.each do |r| end puts "#{successful} records successfully imported!" -if errors +if errors.length > 0 puts "There were #{errors.length} errors:" errors.each { |e| print e.name + (e == errors.last ? ".\n" : ", ")} puts "These probably occurred because an identically-named record already existed, or because there were multiple entries with the same name in the csv file."