Bluehawk
Bluehawk copied to clipboard
Customize filename extension
Tried it today and it worked great! However, I would like to be able to customize the file name and file extension, such as:
bluehawk snip -o path/to/my-customized-filename.md <input-directory-or-file>
thank you for submitting the issue! we're adding to our roadmap.
i think the API would be something like:
bluehawk snip -o path/to/output_dir input-file.foo --ext bar
and this'd create output-file.bar
Thanks for raising @lilisha-unity! Can you tell us about how this will be used?
- Expected behavior if input-directory contains multiple files? i.e. should the custom name be a template (instead of
<sourcefile>.<snippetname>.snippet.<sourceextension>
)? Or just a literal name that we write to? - Any assumptions about custom extension? For example, is ".md" expected to produce valid markdown or just whatever language while the file has md extension?
Thanks!
@mongodben to add an ext flag, see here:
- Add option to CLI: https://github.com/mongodb-university/Bluehawk/blob/main/src/cli/commandModules/snip.ts#L17
- Add option to action args: https://github.com/mongodb-university/Bluehawk/blob/main/src/bluehawk/actions/snip.ts#L11
- Apply extension: https://github.com/mongodb-university/Bluehawk/blob/main/src/bluehawk/actions/snip.ts#L190