duckduckgo / p5-app-duckpan

DuckDuckHack OpenSource Development Application
http://metacpan.org/module/App::DuckPAN
Other
53 stars 47 forks source link

get_ia_type() does not throw error when run from inside the 'template' directory #290

Closed sd43 closed 8 years ago

sd43 commented 8 years ago

If duckpan is run from outside the root directory of an IA repository, get_ia_type() should throw an exception 'Must be run from the root of a checked-out Instant Answer repository., but it does not do this when run inside the template subdirectory.

The reason is that one of lib/Goodie or lib/Spice subdirectories is present inside template/ and that is what get_ia_type() looks for when trying to figure out if it is run from the root directory.

Here's a sample session:

srvsh$ pwd
/home/srvsh/ddg/zeroclickinfo-goodies

srvsh$ cd lib
srvsh$ pwd
/home/srvsh/ddg/zeroclickinfo-goodies/lib
srvsh$ duckpan new HelloWorld
[FATAL]  Must be run from the root of a checked-out Instant Answer repository.

srvsh$ cd ..
srvsh$ cd template
srvsh$ pwd
/home/srvsh/ddg/zeroclickinfo-goodies/template
srvsh$ duckpan new HelloWorld
[FATAL]  Template does not exist: template/lib/DDG/Goodie/Example.pm

The last set of commands shows a misleading error due to the issue.

GuiltyDolphin commented 8 years ago

@srvsh Resolved in #338.