From 56069ee20ff93cb781266d549498fce68dc4eb11 Mon Sep 17 00:00:00 2001 From: Zach Thompson Date: Wed, 1 Jun 2016 12:08:15 -0600 Subject: [PATCH] Only check for IA repo when doing IA-specific commands --- lib/App/DuckPAN.pm | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/App/DuckPAN.pm b/lib/App/DuckPAN.pm index a32d47d..a6deee2 100644 --- a/lib/App/DuckPAN.pm +++ b/lib/App/DuckPAN.pm @@ -632,7 +632,15 @@ sub checking_dukgo_user { sub get_ia_type { my ($self) = @_; - return $self->repository; + + my $repo = $self->repository; + unless ($repo) { + $self->emit_and_exit(-1, + 'Must be run from within an Instant Answer repository' + ); + } + + return $repo; } sub empty_cache { @@ -682,11 +690,6 @@ sub initialize_working_directory { continue { $check_path = $check_path->parent; } - unless ($self->repository) { - $self->emit_and_exit(-1, - 'Must be run from within an Instant Answer repository' - ); - } } sub BUILD {