]> err.no Git - pwstore/commitdiff
Catch if we run ls in a dir that isn't a store
authorPeter Palfrader <peter@palfrader.org>
Thu, 18 Sep 2008 21:08:02 +0000 (23:08 +0200)
committerPeter Palfrader <peter@palfrader.org>
Thu, 18 Sep 2008 21:08:02 +0000 (23:08 +0200)
pws

diff --git a/pws b/pws
index 7cbc8f4605896dd0e6387067032b2295605671ad..a4a947ae108a3edd907c916c7aa23310cf304593 100755 (executable)
--- 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)