Skip to content
This repository has been archived by the owner on Oct 15, 2022. It is now read-only.

Commit

Permalink
Only check for IA repo when doing IA-specific commands
Browse files Browse the repository at this point in the history
  • Loading branch information
zachthompson committed Jun 1, 2016
1 parent a69271c commit 56069ee
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions lib/App/DuckPAN.pm
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 56069ee

Please sign in to comment.