Skip to content

Add SHA-256 hash utility#98

Open
Josephat-S wants to merge 1 commit into
devfrom
fix/file-deduplication
Open

Add SHA-256 hash utility#98
Josephat-S wants to merge 1 commit into
devfrom
fix/file-deduplication

Conversation

@Josephat-S

Copy link
Copy Markdown
Contributor

This pull request enhances the template compilation process in src/generate.js by introducing deduplication to avoid unnecessary file writes and by improving logging to reflect these changes. The main improvements are the addition of a SHA-256 hash comparison to detect unchanged files, and the reporting of both written and skipped files.

Template compilation deduplication and logging improvements:

  • Added a sha256 helper function using Node's crypto module to compute file content hashes, enabling detection of unchanged files before writing. [1] [2]
  • Updated the template compilation loop to skip writing files whose compiled output matches the existing content, incrementing a skippedCount and logging skipped files in verbose mode.
  • Improved summary logging after compilation to show both the number of files written and the number skipped due to no changes.

Closes #87

@Josephat-S Josephat-S requested review from a team and ISONIC0788 June 14, 2026 14:03
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.

ISSUE-001 — Implement SHA-256 File Deduplication

1 participant