[Bps-public-commit] r15068 - in sd/trunk: . lib/App/SD/CLI/Command/Attachment lib/App/SD/CLI/Command/Ticket/Comment
spang at bestpractical.com
spang at bestpractical.com
Tue Aug 12 09:14:54 EDT 2008
Author: spang
Date: Tue Aug 12 09:14:14 2008
New Revision: 15068
Modified:
sd/trunk/ (props changed)
sd/trunk/lib/App/SD/CLI/Command/Attachment/Create.pm
sd/trunk/lib/App/SD/CLI/Command/Ticket/Comment.pm
sd/trunk/lib/App/SD/CLI/Command/Ticket/Comment/Create.pm
Log:
r47145 at loki: spang | 2008-07-25 11:14:33 +0100
r47130 at loki (orig r14497): sartak | 2008-07-25 08:44:35 +0100
r65175 at onn: sartak | 2008-07-25 03:42:45 -0400
If the user exits their editor (or uses :wq with no content), then don't create the attachment or comment
r47131 at loki (orig r14498): sartak | 2008-07-25 08:44:50 +0100
r65176 at onn: sartak | 2008-07-25 03:44:26 -0400
Fix "./bin/sd ticket comment --id=1" creating a new ticket
Modified: sd/trunk/lib/App/SD/CLI/Command/Attachment/Create.pm
==============================================================================
--- sd/trunk/lib/App/SD/CLI/Command/Attachment/Create.pm (original)
+++ sd/trunk/lib/App/SD/CLI/Command/Attachment/Create.pm Tue Aug 12 09:14:14 2008
@@ -6,7 +6,13 @@
before run => sub {
my $self = shift;
- $self->set_prop(content => $self->get_content(type => 'attachment'));
+
+ my $content = $self->get_content(type => 'attachment');
+
+ die "Aborted.\n"
+ if length($content) == 0;
+
+ $self->set_prop(content => $content);
};
__PACKAGE__->meta->make_immutable;
Modified: sd/trunk/lib/App/SD/CLI/Command/Ticket/Comment.pm
==============================================================================
--- sd/trunk/lib/App/SD/CLI/Command/Ticket/Comment.pm (original)
+++ sd/trunk/lib/App/SD/CLI/Command/Ticket/Comment.pm Tue Aug 12 09:14:14 2008
@@ -2,6 +2,8 @@
use Moose;
extends 'App::SD::CLI::Command::Ticket::Comment::Create';
+sub type { 'comment' }
+
__PACKAGE__->meta->make_immutable;
no Moose;
Modified: sd/trunk/lib/App/SD/CLI/Command/Ticket/Comment/Create.pm
==============================================================================
--- sd/trunk/lib/App/SD/CLI/Command/Ticket/Comment/Create.pm (original)
+++ sd/trunk/lib/App/SD/CLI/Command/Ticket/Comment/Create.pm Tue Aug 12 09:14:14 2008
@@ -8,8 +8,14 @@
# override args to feed in that ticket's uuid as an argument to the comment
before run => sub {
my $self = shift;
+
+ my $content = $self->get_content(type => 'comment', default_edit => 1);
+
+ die "Aborted.\n"
+ if length($content) == 0;
+
$self->set_prop(ticket => $self->cli->uuid);
- $self->set_prop(content => $self->get_content(type => 'comment', default_edit => 1));
+ $self->set_prop(content => $content);
};
__PACKAGE__->meta->make_immutable;
More information about the Bps-public-commit
mailing list