Skip to content

notepad4: Fix persistence#17289

Merged
z-Fng merged 5 commits intoScoopInstaller:masterfrom
okchin:patch-1
Feb 26, 2026
Merged

notepad4: Fix persistence#17289
z-Fng merged 5 commits intoScoopInstaller:masterfrom
okchin:patch-1

Conversation

@okchin
Copy link
Contributor

@okchin okchin commented Feb 26, 2026

This PR fixes two critical issues with the Notepad4 manifest:

  1. Folder creation bug: Added pre_install hooks to copy the bundled .ini-default configuration files to their proper .ini names. This not only prevents Scoop from mistakenly creating folders for Notepad4.ini, matepath.ini, and Notepad4 DarkTheme.ini during a fresh installation, but also ensures the application initializes correctly with the author's intended default settings.
  2. Missing configuration: Added Notepad4 DarkTheme.ini to the persist array so users won't lose their dark theme settings after running scoop update.

Closes ScoopInstaller/Scoop#6596

  • Use conventional PR title: <manifest-name[@version]|chore>: <general summary of the pull request>
  • I have read the Contributing Guide

Summary by CodeRabbit

  • Chores
    • Ensure the app creates and initializes missing configuration files on first run so default settings are available.
    • Persist dark theme settings alongside existing preferences so theme choice is retained across updates.

This PR fixes two issues:
1. Added `pre_install` hook to create empty `.ini` files. This prevents Scoop from mistakenly creating folders for `Notepad4.ini` and `matepath.ini` during fresh installations.
2. Added `Notepad4 DarkTheme.ini` to the `persist` array so users won't lose their dark theme settings after a scoop update.
@coderabbitai
Copy link

coderabbitai bot commented Feb 26, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5ff67d0 and 915cf16.

📒 Files selected for processing (1)
  • bucket/notepad4.json

Walkthrough

Added a top-level pre_install array with a PowerShell snippet that ensures Notepad4.ini, matepath.ini, and Notepad4 DarkTheme.ini exist by copying their -default counterparts when missing; updated the persist array to include Notepad4 DarkTheme.ini in bucket/notepad4.json. (36 words)

Changes

Cohort / File(s) Summary
Configuration
bucket/notepad4.json
Added a pre_install array with PowerShell commands to copy/create Notepad4.ini, matepath.ini, and Notepad4 DarkTheme.ini from their -default variants if absent; updated persist to include Notepad4 DarkTheme.ini and adjusted ordering.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • Lutra-Fs

Poem

🐰 I hop through folders, soft and fleet,

I copy defaults so config's neat.
DarkTheme tucked where it belongs,
Notepad4 hums its tiny songs. ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'notepad4: Fix persistence' clearly summarizes the main change, identifying the package and the core fix being addressed.
Description check ✅ Passed The description covers both critical fixes with clear explanations and includes the required PR format elements with checkboxes completed and an issue reference.
Linked Issues check ✅ Passed The PR directly addresses issue #6596 by adding pre_install hooks to prevent directories from being created instead of .ini files and by persisting the dark theme configuration.
Out of Scope Changes check ✅ Passed All changes in bucket/notepad4.json (pre_install array and persist array update) are directly related to fixing the persistence issues identified in #6596.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Contributor

All changes look good.

Wait for review from human collaborators.

notepad4

  • Lint
  • Description
  • License
  • Hashes
  • Checkver
  • Autoupdate

Check the full log for details.

@z-Fng z-Fng changed the title notepad4: Fix persist folder creation bug and missing dark theme notepad4: Fix persistence Feb 26, 2026
@z-Fng
Copy link
Member

z-Fng commented Feb 26, 2026

/verify

@github-actions
Copy link
Contributor

All changes look good.

Wait for review from human collaborators.

notepad4

  • Lint
  • Description
  • License
  • Hashes
  • Checkver
  • Autoupdate

Check the full log for details.

@z-Fng
Copy link
Member

z-Fng commented Feb 26, 2026

/verify

@github-actions
Copy link
Contributor

All changes look good.

Wait for review from human collaborators.

notepad4

  • Lint
  • Description
  • License
  • Hashes
  • Checkver
  • Autoupdate

Check the full log for details.

z-Fng
z-Fng approved these changes Feb 26, 2026
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@bucket/notepad4.json`:
- Around line 33-35: The update migration only skips creating missing files by
checking Test-Path against "$persist_dir\\$_", but it doesn't handle cases where
that path exists as a directory (e.g., Notepad4.ini became a folder) so the bad
state remains; update the migration logic around Test-Path and Copy-Item to
detect when the existing path is a directory (use Get-Item and check
.PSIsContainer) and, if so, remove or rename that directory before copying the
default file from "$dir\\$_-default" to "$dir\\$_" (use Copy-Item with -Force
and appropriate error handling) so existing incorrect directory entries are
replaced by the correct persisted files.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bd88b7e and 5ff67d0.

📒 Files selected for processing (1)
  • bucket/notepad4.json

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Copy link
Member

@z-Fng z-Fng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution!

@z-Fng z-Fng merged commit 7cd01d4 into ScoopInstaller:master Feb 26, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Notepad4 persist configuration files were treated as directories link

2 participants