dmgerman / ninka

a license identification tool for Source Code
http://ninka.turingmachine.org
GNU General Public License v2.0
105 stars 31 forks source link

Fix bug in path detection when ninka.pl called from its own directory. #3

Closed yaauie closed 8 years ago

yaauie commented 11 years ago

When attempting to use ninka for the first time, I executed it from its own directory:

╭ < yaauie@beorn ~/src/ninka (master =) >
╰ $ perl ninka.pl -v ../redis/COPYING
/Users/yaauie/src/ninkaStarting: ../redis/COPYING;
../redis/COPYING;Creating comments file:Running ninka.pl/extComments/extComments.pl -v -c1 '../redis/COPYING':sh: ninka.pl/extComments/extComments.pl: Not a directory
execution of program [ninka.pl/extComments/extComments.pl -v -c1 '../redis/COPYING'] failed: status [126] at ninka.pl line 168.

This small patch allows the script to be executed from its parent's directory, while still allowing the standard case.

dmgerman commented 9 years ago

Thanks Ryan (and sorry for the delay). I have fixed the code with this, which is probably much better:

-my $path = $0; +my $path = dirname($0);

-$path =~ s/\/+[^\/]+$//;

bufferoverflow commented 8 years ago

ok, so this issue can be closed?

dmgerman commented 8 years ago

Ninka execution has been rewritten. This patch is no longer necessary.