From 717c1c8d91b046a9cb76b3db5adbd88d82da3d3c Mon Sep 17 00:00:00 2001 From: Andrew Chilton Date: Fri, 22 Jan 2010 12:13:28 +1300 Subject: [PATCH] cil-b8061619: Made sure it complains and quits before running any command (except init) --- bin/cil | 8 ++++++++ issues/i_b6033e30.cil | 4 ++-- issues/i_b8061619.cil | 4 ++-- lib/CIL/Utils.pm | 2 +- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/bin/cil b/bin/cil index 0205e27..7c7d8b5 100755 --- 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); diff --git a/issues/i_b6033e30.cil b/issues/i_b6033e30.cil index 7450ca2..ca4a4b9 100644 --- a/issues/i_b6033e30.cil +++ b/issues/i_b6033e30.cil @@ -1,10 +1,10 @@ Summary: can't find issues folder -Status: New +Status: Cancelled CreatedBy: Name 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 diff --git a/issues/i_b8061619.cil b/issues/i_b8061619.cil index 994f188..d34711b 100644 --- a/issues/i_b8061619.cil +++ b/issues/i_b8061619.cil @@ -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 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. diff --git a/lib/CIL/Utils.pm b/lib/CIL/Utils.pm index a00608e..cad802f 100644 --- a/lib/CIL/Utils.pm +++ b/lib/CIL/Utils.pm @@ -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; -- 2.39.5