App-PRT icon indicating copy to clipboard operation
App-PRT copied to clipboard

Find project root directory based on Makefile.PL or Build.PL in addition to cpanfile

Open cxw42 opened this issue 5 years ago • 1 comments

Currently, App::PRT::Collector::AllFiles::find_project_root_directory() only looks for cpanfile to determine the project root. However, this means that it cannot find non-cpanfile, non-git clone project roots. Example repro:

  • Download Term::Choose from https://cpan.metacpan.org/authors/id/K/KU/KUERBIS/Term-Choose-1.653.tar.gz . (I picked this one at random as an example.)
  • tar xvzf Term-Choose-1.653.tar.gz
  • cd Term-Choose-1.653
  • prt list_files

Expected output: names of files in ., lib, t, xt

Observed output: Cannot decide target files at <...>/site_perl/5.26.2/App/PRT/CLI.pm line 57.

I think the fix may be as simple as changing this to:

if (-e $current->file('cpanfile') || -e $current->file('Makefile.PL') || -e $current->file('Build.PL')) {

What do you think? Thanks!

cxw42 avatar Jul 08 '19 13:07 cxw42

@cxw42 It seems nice suggestion. There is no reason for ignoring Makefile.PL, because, all of my daily projects are using git or using cpanfile.

hitode909 avatar Jul 16 '19 03:07 hitode909