supplying an existing directory to --config-file is unsupported
authorgc <gc>
Sun, 18 Sep 2005 19:33:58 +0000 (19:33 +0000)
committergc <gc>
Sun, 18 Sep 2005 19:33:58 +0000 (19:33 +0000)
bin/booh-backend

index 4b2035d5947701eb0efb68858c1fa3c6b2b7ab65..83aa16a4f33ae4dcee72cf620f7f5ce1de8f45b9 100755 (executable)
@@ -126,8 +126,12 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.") %
             when '--config-skel'
                 arg = File.expand_path(arg)
                 if File.exists?(arg)
-                    msg 1, _("Config skeleton file already exists, backuping to %s.backup") % arg
-                    File.rename(arg, "#{arg}.backup")
+                    if File.directory?(arg)
+                        die _("Config skeleton file (%s) already exists and is a directory! Please change the filename.") % arg
+                    else
+                        msg 1, _("Config skeleton file already exists, backuping to %s.backup") % arg
+                        File.rename(arg, "#{arg}.backup")
+                    end
                 end
                 $config_writeto = arg
                 $mode = 'gen_config'