abhinav / git-spice

Manage stacked Git branches
https://abhinav.github.io/git-spice/
GNU General Public License v3.0
220 stars 11 forks source link

gs bs: bail early if $EDITOR variable not set #310

Closed sywhang closed 2 months ago

sywhang commented 2 months ago

Was trying this tool out on a new linux box earlier, and noticed that on a machine w/o $EDITOR variable configured, the prompt takes me straight to ask whether the PR should be marked as draft before bailing with an error on running the empty command from open editor action.

Ex)

❯ gs bs
Title: Remove glide.yaml
Title: Remove glide.yaml
Body: Press [e] to open  or [enter/tab] to skip
no editor found: please set $EDITOR
Draft: [y/N]
FTL gs: prompt form: no editor found: please set $EDITOR
abhinav commented 2 months ago

@sywhang what version are you using? This should’ve been fixed in 0.2: https://github.com/abhinav/git-spice/releases/tag/v0.2.0

We use “git var GIT_EDITOR” to get the value, and fall back to vi if that’s under.