Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change note creation script uses EDITOR environment variable #18739

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@
"${input:name}",
"${input:categoryQuery}"
],
"options": {
"env": {
"EDITOR": "code -r",
}
},
"presentation": {
"reveal": "never",
"close": true
Expand All @@ -67,6 +72,11 @@
"${input:name}",
"${input:categoryLibrary}"
],
"options": {
"env": {
"EDITOR": "code -r"
}
},
"presentation": {
"reveal": "never",
"close": true
Expand Down
8 changes: 5 additions & 3 deletions misc/scripts/create-change-note.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env python3

# Creates a change note and opens it in VSCode for editing.
# Creates a change note and opens it in $EDITOR (or VSCode if the environment
# variable is not set) for editing.

# Expects to receive the following arguments:
# - What language the change note is for
Expand Down Expand Up @@ -51,5 +52,6 @@
with open(change_note_file, "w") as f:
f.write(change_note)

# Open the change note file in VSCode, reusing the existing window if possible
os.system(f"code -r {change_note_file}")
editor = os.environ.get('EDITOR', 'code')

os.system(f"{editor} {change_note_file}")