From: Peter Palfrader Date: Thu, 18 Sep 2008 21:08:02 +0000 (+0200) Subject: Catch if we run ls in a dir that isn't a store X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=141698d98dd2999936d1d5678049576abc6b8384;p=pwstore Catch if we run ls in a dir that isn't a store --- diff --git a/pws b/pws index 7cbc8f4..a4a947a 100755 --- a/pws +++ b/pws @@ -401,6 +401,10 @@ class Ls end puts "#{dirname}:" Dir.chdir(dirname) do + unless FileTest.exists?(".users") + STDERR.puts "The .users file does not exists here. This is not a password store, is it?" + exit(1) + end dir.sort.each do |filename| next if (filename =~ /^\./) and not (@all >= 3) stat = File::Stat.new(filename)