sindresorhus / np

A better `npm publish`
MIT License
7.56k stars 298 forks source link

Open release notes in the editor before opening GitHub #544

Closed vadimdemedes closed 4 years ago

vadimdemedes commented 4 years ago

Description

I recently edited somewhat long release notes with a lot of commits inside and I found it to be much easier to do when copy-pasting into my editor and then pasting the final text back to GitHub. I think it'd be cool if np did that out-of-the-box.

Is the feature request related to a problem?

No.

Possible implementation

  1. Save generated release notes into a temporary file
  2. Read EDITOR environment variable (open browser if it's missing and skip the whole thing)
  3. Open this file with command stored in EDITOR environment variable, but with a -w (wait) flag appended, which will keep the process open until user saves and closes file
  4. Read the same file and open GitHub with edited release notes, instead of generated ones

Alternatives

Copy paste into editor and copy paste back into GitHub. Not that big of a deal, just thought if anyone is doing the same workaround. If there are a lot of people, might be something useful to add to np.

sindresorhus commented 4 years ago

I have mixed feelings about it. I do agree it's nicer to edit long release notes in a proper editor, however, most releases I do are quick ones, where having to do it in the editor would slow me down.

Also, this would only work on macOS, as the -w is for the open command.

Have you tried https://github.com/GhostText/GhostText ? It lets you open any web textarea in your editor.

vadimdemedes commented 4 years ago

No worries, as I’ve mentioned in the issue, it’s not a big deal to copy paste a couple times!

Forgot about GhostText, will try it too, thanks.