Couscous icon indicating copy to clipboard operation
Couscous copied to clipboard

Infinite .couscous/generated loop + excludes ignored

Open geekish opened this issue 8 years ago • 5 comments

I'm getting an infinite loop of directories e.g. .couscous/generated/.couscous/generated/....

Couscous also appears to be ignoring my excludes, e.g. bower_components. I tried both the %gitignore% and listing every directory/file and neither worked. I'm not sure if this is the cause of the infinite loop, a side effect, or an unrelated bug.

I tried using both my global install and a fresh, local couscous.phar. Same result.

geekish avatar Nov 18 '16 19:11 geekish

@geekish that's weird, .couscous is added manually here: https://github.com/CouscousPHP/Couscous/blob/master/src/Model/Project.php#L136 Is that a public repository that I could try? Are you running the command with the --target option or with a different directory specified (i.e. running the command outside of the repository directory)?

mnapoli avatar Nov 20 '16 10:11 mnapoli

I did a bit of retesting yesterday and I seem to be able to prevent the infinite loop from happening if I run couscous clear before couscous preview/generate. I was using the default directory.

I'm noticing though that excludes are not taken into account in the LoadAssets step or the ProcessTwigFiles step, where new instances of Finder are used.

geekish avatar Nov 20 '16 15:11 geekish

Right because (IIRC) the template is in a sub-directory, so excludes apply to the root directory, do you have customized the template directory? And what about the 2 other questions?

mnapoli avatar Nov 21 '16 07:11 mnapoli

I was trying to preview a template in its own directory using template: ., so it wasn't in a subdirectory. I can definitely see how that could cause problems, but I saw it in the repo for Template-Light so I thought I'd see if it worked.

As for running the command I was used a global composer install of couscous, and couscous.phar, both from directly inside the template repository, with no special options/flags.

The repository isn't public because it's a WIP, but I will be sure to test template: ., and actually copying the template directory into the project I'm designing it for.

geekish avatar Nov 22 '16 16:11 geekish

Same here. I was testing https://github.com/CouscousPHP/Template-Basic And here the result: screenshot from 2017-06-09 14-07-19

Pretty big. You may check the disk usage: du -h . @ https://u.teknik.io/EvACG.txt

As @geekish said, after I removed these on couscous.yml

template:
    directory: .

It works fine.

$ ./vendor/bin/couscous preview 
Generating /home/indrakaw/workplace/Template-Basic to /home/indrakaw/workplace/Template-Basic/.couscous/generated
[notice] Fetching template from https://github.com/CouscousPHP/Template-Light.git
Server running on http://127.0.0.1:8000

indrakaw avatar Jun 09 '17 07:06 indrakaw