[Bps-public-commit] Prophet branch, config-gitlike, updated. eb41224ca6bc47e1447b4b2fea44f181ebacaac8

spang at bestpractical.com spang at bestpractical.com
Fri Jun 26 06:19:34 EDT 2009


The branch, config-gitlike has been updated
       via  eb41224ca6bc47e1447b4b2fea44f181ebacaac8 (commit)
      from  00486b0b4111839cb2deb88f7ca4fda9cf1e1275 (commit)

Summary of changes:
 lib/Prophet/CLI/Command/Config.pm |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

- Log -----------------------------------------------------------------
commit eb41224ca6bc47e1447b4b2fea44f181ebacaac8
Author: Christine Spang <spang at mit.edu>
Date:   Fri Jun 26 13:19:18 2009 +0300

    Whoops, allow editing the config file if it doesn't yet, as long as it's contained in a directory writable by the user.

diff --git a/lib/Prophet/CLI/Command/Config.pm b/lib/Prophet/CLI/Command/Config.pm
index d109840..47dd29d 100644
--- a/lib/Prophet/CLI/Command/Config.pm
+++ b/lib/Prophet/CLI/Command/Config.pm
@@ -70,7 +70,8 @@ sub run {
 
         die "You don't have write permissions on "
             .$self->config_filename.", can't edit!\n"
-            if ! -w $self->config_filename;
+            if (-e $self->config_filename && ! -w $self->config_filename)
+                || ! -W (File::Spec->splitpath($self->config_filename))[1];
         my $template = $self->make_template;
 
         while ( !$done ) {

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list