nedbat / cog

Small bits of Python computation for static files
MIT License
340 stars 26 forks source link

Added new file list call &FILELIST where paths are relative to the FILELIST #22

Closed RA-Phil-K closed 9 months ago

RA-Phil-K commented 1 year ago

Added new file list call &FILELIST. This differs from @FILELIST in that the working directory is changed to the directory of FILELIST before coging the files in the list. This has the effect that files and directories in the FILELIST are relative to the FILELIST instead of where cog is called.

nedbat commented 1 year ago

Hi, thanks for the idea. Can you help me understand how you are using cog? This seems almost like something that could be handled outside of cog...

RA-Phil-K commented 1 year ago

For my use case, I'm using this with some system verilog where I have some IP cores that I'm using cog to automate some aspects of the code. This feature makes the modules more portable since each module can have a file list and the module can be located anywhere in the hierarchy of the project. The is especially useful when the project contains sub-sub-modules that are called by sub-modules.

I'm sure there are workarounds to do this outside of cog, but for my use case its much easier and more direct to do it this way.

nedbat commented 9 months ago

Thanks! I added some tests and documentation.