fix(updater): resolve the dsh CLI through symlinks #45
No reviewers
Labels
No labels
area/dsh
area/forgejo
experiment
priority/later
priority/next
priority/now
type/bug
type/task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
dsh-plugins/dsh-gitea!45
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/44-updater-symlink"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Fixes #44. On a normal global install DSH runs through a symlink chain (
/usr/local/bin/dsh -> .../@deepseek-ai/dsh/lib/bin.js).findDshCliEntry()resolvedprocess.argv[1]without following symlinks, walked from/usr/local/bin, found nopackage.json, returnedundefined, and the updater failed before spawningdsh plugin. The status endpoint correctly saidcanAutoUpdate: false, but the UI ignored it and still offered the Update button.This PR:
binbefore comparing, withrealpathSync;findDshCliEntry(entryValue)for direct testing;installExactsay exactly what to run when the CLI cannot be found:Automatic update is unavailable: could not locate the dsh CLI. Install manually: dsh plugin --profile web add <tarball>;canAutoUpdatefrom the status response, hides the Update button when false, and shows an inline “install the tarball manually” hint;Verification
@deepseek-ai/dshpackage tree +bin/dshsymlink →findDshCliEntry(symlink)returns the reallib/bin.js; direct path also works; missing path returnsundefined.installExactmissing-CLI error includes the manual command.npm test143/143, leak scan + syntax clean (CHECK_EXIT=0).findDshCliEntry('/usr/local/bin/dsh')→ not found;/opt/node-v24.22.0-linux-x64/lib/node_modules/@deepseek-ai/dsh/lib/bin.js.Release
This needs a 0.8.1 publish; an installed 0.7.40-dsh.7 updater cannot fix itself, so bootstrap 0.8.1 once with the manual tarball command, then the UI updater works.
Closes #44.