atomist-attic / rug

DEPRECATED Runtime for Rugs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add ability to find file/get content of a file inside generator/editor archive that is executing

tanya-coding opened this issue · comments

Example use case: editor needs to prepend each file in a project with some predefined content (e.g. license comment). Editor would have a file with license comment content but there is no way to get content of that file without first executing project.copyEditorBackingFileOrFailToDestination and then at the end calling project.deleteFile to clean up (specific example: https://github.com/atomist/rug-rugs/blob/license/.atomist/editors/AddLicense.ts#L85)

It would be helpful to be able to find file and get content of a file inside the generator/editor that is being executed not just inside the project it's executing on.

licensing-editors - which for some reason defunct, did this:

let licenseFile = project.backingArchiveProject().findFile(licenseFileName)`

Does this work for you?

Yep, that works! cc: @ddgenome