aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Kellermann <Benjamin.Kellermann@gmx.de>2018-04-23 05:32:47 +0200
committerBenjamin Kellermann <Benjamin.Kellermann@gmx.de>2018-04-23 05:32:47 +0200
commit59894a8284ad4fe70d174f00aada3e0c8888bfed (patch)
treefbedf6d01939fdb47883ceeb16ef7f1ace889097
parent22230a003a162f637bd260cebbb6b35b45d0b73d (diff)
prevent error when launching check.cgi after a fail
-rwxr-xr-xcheck.cgi8
1 files changed, 6 insertions, 2 deletions
diff --git a/check.cgi b/check.cgi
index 4abe9ca..fcf86cd 100755
--- a/check.cgi
+++ b/check.cgi
@@ -29,7 +29,7 @@ problems = []
hints = []
begin
-
+
hints << "You might want to config your environment within the file 'config.rb' (see 'config_sample.rb' for a starting point)" unless File.exists?("config.rb")
begin
@@ -50,6 +50,10 @@ unless File.writable?(".")
problems << ["Your webserver needs write access to #{File.expand_path(".")}"]
else
testdir = "this-is-a-test-directory-created-by-check.cgi-it-should-be-deleted"
+ if Dir.exists?(testdir) # might exist from a previous test
+ require "fileutils"
+ FileUtils.rm_r(testdir)
+ end
Dir.mkdir(testdir)
Dir.chdir(testdir)
VCS.init
@@ -88,7 +92,7 @@ else
}.join("\n - ")
end
end
-#4. You have to build a .mo file from the .po file in order to use the
+#4. You have to build a .mo file from the .po file in order to use the
#localization. Type:
#make
#This requires libgettext-ruby-util, potool, and make to be installed.