Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --overwrite flag to staticrypt #200

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

vuyp
Copy link

@vuyp vuyp commented Sep 3, 2024

Fixes #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.

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.
@robinmoisson
Copy link
Owner

robinmoisson commented Sep 5, 2024

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!

@robinmoisson
Copy link
Owner

(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 index.js and helper.js which are all over the place with their functions with too many parameters, but it might make sense to do that after your PR. So just letting you know I haven't forgotten it and will get to it at some point!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

staticrypt not rendering in-place as expected
2 participants