fix(run): add missing binary check for lark-cli execution#362
fix(run): add missing binary check for lark-cli execution#362sang-neo03 merged 1 commit intomainfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthrough
Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes 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 docstrings
🧪 Generate unit tests (beta)
Comment |
Greptile SummaryAdds an Confidence Score: 5/5Safe to merge — minimal, correct change with no P0 or P1 findings. The diff is a focused, one-concern fix: add an existence check, emit a helpful error, and exit. The happy path is unchanged, the error path is straightforward, and all remaining observations are P2 style suggestions. No files require special attention.
|
| Filename | Overview |
|---|---|
| scripts/run.js | Adds fs.existsSync pre-check before binary execution; emits a clear error message with recovery instructions when binary is missing. File mode also corrected to 0755. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A([lark CLI invoked]) --> B[Resolve binary path\nbin/lark-cli or bin/lark-cli.exe]
B --> C{fs.existsSync bin?}
C -- No --> D[console.error:\nBinary not found\nCauses + recovery cmd]
D --> E([process.exit 1])
C -- Yes --> F[execFileSync bin\nwith stdio: inherit]
F -- success --> G([exit 0])
F -- throws --> H{e.status?}
H -- non-null --> I([exit e.status])
H -- null signal kill --> J([exit 1])
Reviews (1): Last reviewed commit: "fix(run): add missing binary check for l..." | Re-trigger Greptile
🚀 PR Preview Install Guide🧰 CLI updatenpm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@d535fb60632c5e38ce3487312e7bb9c0c69e967a🧩 Skill updatenpx skills add larksuite/cli#fix/run-js-missing-binary-check -y -g |
|
Whether to add executable permission check ? @sang-neo03 |
No need to add an executable permission check. |
⏺ Summary
When @larksuite/cli is installed with ignore-scripts=true, the postinstall script that
downloads the Go binary is skipped. Currently scripts/run.js silently exits with code
1, giving users no indication of what went wrong or how to fix it.
Changes
failed) and recovery command (node scripts/install.js)
Test Plan
error message with recovery instructions
happy path)
Related Issues
Summary by CodeRabbit