]> git.mjollnir.org Git - cil.git/commitdiff
cil-b8061619: Made sure it complains and quits before running any command (except...
authorAndrew Chilton <andychilton@gmail.com>
Thu, 21 Jan 2010 23:13:28 +0000 (12:13 +1300)
committerAndrew Chilton <andychilton@gmail.com>
Thu, 21 Jan 2010 23:13:28 +0000 (12:13 +1300)
bin/cil
issues/i_b6033e30.cil
issues/i_b8061619.cil
lib/CIL/Utils.pm

diff --git a/bin/cil b/bin/cil
index 0205e2744694d3580d0a623776b0dfabbfccf1ee..7c7d8b599cae137e6f169a6255fb91ad669079b4 100755 (executable)
--- a/bin/cil
+++ b/bin/cil
@@ -32,6 +32,7 @@ use CIL;
 use CIL::Issue;
 use CIL::Comment;
 use CIL::Attachment;
+use CIL::Utils;
 
 ## ----------------------------------------------------------------------------
 # constants
@@ -102,7 +103,14 @@ my %BOOLEAN_ARGS = (
     my( $command ) =  grep { $command_name eq $_->name } CIL->commands
         or Getopt::Mixed::abortMsg("'$command_name' is not a valid cil command.");
 
+    # make a new $cil object
     my $cil = CIL->new();
+
+    # for all commands (except init), we need to know we can see the proper paths
+    # (ie. issues/)
+    CIL::Utils->check_paths( $cil )
+        unless $command_name eq 'init';
+
     $cil->read_config_user();
     $cil->read_config_file();
     $cil->check_args($args);
index 7450ca28901cc51f76779c51b7be170584422633..ca4a4b9658595420e6c6d569c47a0262fca53e0a 100644 (file)
@@ -1,10 +1,10 @@
 Summary: can't find issues folder
-Status: New
+Status: Cancelled
 CreatedBy: Name <me@example.com>
 AssignedTo: 
 Label: Milestone-v0.06
 Inserted: 2009-06-06T09:39:09
-Updated: 2010-01-21T22:59:19
+Updated: 2010-01-21T23:12:50
 
 Description ...
 I created an issue, while in the issues folder.. it doesn't write it
index 994f188a4fb6ea536c8469502fe09e9402c963e3..d34711b15c89f132de4e0f4c920163dd8c3ec70e 100644 (file)
@@ -1,10 +1,10 @@
 Summary: cil add should detect early on if cil init hasn't been run
-Status: New
+Status: Finished
 CreatedBy: Andrew Ruthven <andrew@etc.gen.nz>
 AssignedTo: 
 Label: Milestone-v0.06
 Inserted: 2008-09-22T03:26:21
-Updated: 2010-01-21T22:59:19
+Updated: 2010-01-21T23:11:51
 
 Currently if you run cil add you can start to create a bug report, hit save
 and then cil bombs out not being able to create a file inside issues.
index a00608e38342b79fdfed0b5894060ca29346ceb0..cad802fc0f717717663d649c317536de8ea5cff3 100644 (file)
@@ -78,7 +78,7 @@ sub parse_from_lines {
             $data->{$key} = $value;
         }
     }
-    
+
     # now read everything that's left into the $last_field field (if there is one)
     $data->{$last_field} = join("\n", @lines)
         if defined $last_field;