cudatext: Improve persistence#17092
Conversation
WalkthroughManifest for CudaText updated: description expanded, Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant User
participant Scoop
participant Manifest as "cudatext.json"
participant FS as Filesystem
User->>Scoop: install/update cudatext
Scoop->>Manifest: read manifest (persist, post_install)
Scoop->>FS: extract package files (includes `py`, `data`, `settings`, `*.original`)
Scoop->>Scoop: run post_install script
Scoop->>FS: for dir in [py,data]: if dir/original exists -> copy contents to dir
Scoop->>FS: remove dir/original after copy
Scoop->>User: finish install/update
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment Tip You can enable review details to help with troubleshooting, context usage and more.Enable the |
|
All changes look good. Wait for review from human collaborators. cudatext
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@bucket/cudatext.json`:
- Around line 20-27: In the post_install PowerShell block that iterates "'py',
'data' | ForEach-Object { … }", guard the Copy-Item call against empty
"$dir\$_.original" directories by checking for child items before copying: use
Test-Path/$null check or Get-ChildItem on "$dir\$_.original" and only invoke
Copy-Item when children exist; keep the existing Remove-Item behavior for
cleanup. This prevents non-terminating Copy-Item errors when an upstream release
provides an empty .original folder while leaving the rest of the post_install
logic unchanged.
🧹 Nitpick comments (1)
bucket/cudatext.json (1)
42-48: Handle missing uninstaller batch file; verify registry scope.If no
un*.cmdexists,$batch_fileis$nullandStart-Processwill throw, leaving the handler in place. Also, please confirm whether CudaText ever registers the handler under HKCU; if so, the early HKLM-only check would skip cleanup for per-user installs.🛠️ Suggested guard for missing batch file
if (-not (is_admin)) { abort "`n[ERROR] $app requires admin rights to $cmd." } $batch_file = Get-ChildItem -Path $dir -Filter 'un*.cmd' -File | Select-Object -First 1 + if (-not $batch_file) { abort "`n[ERROR] Missing uninstaller script (un*.cmd) in $dir." } Start-Process -FilePath $batch_file.FullName -NoNewWindow -Wait }
|
/verify |
|
All changes look good. Wait for review from human collaborators. cudatext
|
|
/verify |
|
All changes look good. Wait for review from human collaborators. cudatext
|
Summary
Restructures the
cudatextmanifest to support full persistence of add-ons and data, handles core component updates via.originaldirectories, and automates shell extension removal.Related issues or pull requests
Changes
descriptionto provide a more comprehensive overview of the editor's features.licensefield with a full SPDX identifier and a direct URL to the license file.post_installlogic to move files from.originaldirectories to active directories (pyanddata), ensuring core updates are applied while respecting the persistence layer.persistfield to includepyanddatafolders, preserving Python-based add-ons and application data across updates.Edit:
Add anuninstallerscript to automate the removal of the Explorer context menu handler using the application's own uninstallation batch files.Include a registry check to ensure the uninstaller only runs if the context menu handler is present.Add anexplorerrestart command in the uninstaller to ensure shell extensions are refreshed immediately after removal.Notes
Testing
The test results are as follows:
<manifest-name[@version]|chore>: <general summary of the pull request>Summary by CodeRabbit
New Features
Improvements