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.
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 thetemplate
subdirectory.The reason is that one of
lib/Goodie
orlib/Spice
subdirectories is present insidetemplate/
and that is whatget_ia_type()
looks for when trying to figure out if it is run from the root directory.Here's a sample session:
The last set of commands shows a misleading error due to the issue.