Conversation
Fixes robinmoisson#196 Add support for the `--overwrite` flag to overwrite files in-place. * **cli/helpers.js** - Add `overwrite` parameter to `getFullOutputPath` and `recursivelyApplyCallbackToHtmlFiles` functions. - Update `parseCommandLineArguments` to include the `--overwrite` option. * **cli/index.js** - Update `runStatiCrypt` function to handle the `--overwrite` flag. - Update `encodeAndGenerateFile` function to handle the `--overwrite` flag. * **README.md** - Add documentation for the `--overwrite` flag in the CLI section. - Add an example of using the `--overwrite` flag.
|
Thank you @defineprogramming, this PR looks very clean to me! I want to play with it a little bit, I wonder if there would be a simpler way to get this flag working by setting the output directory to the input directory and not having to change any function signature. Otherwise that looks good to me. I'll comment back once I get to explore that, hopefully soon. Thank you for moving this forward! |
|
(Quick update - I've been looking into this and trying things out but have been quite busy and haven't had enough time to reach more of a conclusion on that topic. I really want to refactor these |
|
Just naively thinking about this, wouldn't it be simpler to say if |
Fixes #196
Add support for the
--overwriteflag to overwrite files in-place.cli/helpers.js
overwriteparameter togetFullOutputPathandrecursivelyApplyCallbackToHtmlFilesfunctions.parseCommandLineArgumentsto include the--overwriteoption.cli/index.js
runStatiCryptfunction to handle the--overwriteflag.encodeAndGenerateFilefunction to handle the--overwriteflag.README.md
--overwriteflag in the CLI section.--overwriteflag.