From 141698d98dd2999936d1d5678049576abc6b8384 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Thu, 18 Sep 2008 23:08:02 +0200 Subject: [PATCH] Catch if we run ls in a dir that isn't a store --- pws | 4 ++++ 1 file changed, 4 insertions(+) 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) -- 2.39.5