php-pds / skeleton

Standard PHP package skeleton.
Creative Commons Attribution Share Alike 4.0 International
2.3k stars 167 forks source link

Use currrent working directory as default root path #51

Closed gerardroche closed 2 years ago

gerardroche commented 4 years ago

Currently both the generator and validator use a hard-coded root path when no path argument is given. This can be unexpected especially when you have pds-skeleton installed globally.

Changing it to the cwd will mean the following are the same:

pds-skeleton validate
pds-skeleton validate .

pds-skeleton generate
pds-skeleton generate .

If getcwd() returns false then it defaults to the original hard-coded path.

samwilson commented 4 years ago

getcwd() can return false, so $root should probably fall back to __DIR__ . '/../../../../' as well.