mirror of
https://github.com/github/codeql.git
synced 2026-04-25 08:45:14 +02:00
Merge pull request #18739 from paldepind/change-note-script-editor
Change note creation script uses EDITOR environment variable
This commit is contained in:
10
.vscode/tasks.json
vendored
10
.vscode/tasks.json
vendored
@@ -50,6 +50,11 @@
|
||||
"${input:name}",
|
||||
"${input:categoryQuery}"
|
||||
],
|
||||
"options": {
|
||||
"env": {
|
||||
"EDITOR": "code -r",
|
||||
}
|
||||
},
|
||||
"presentation": {
|
||||
"reveal": "never",
|
||||
"close": true
|
||||
@@ -67,6 +72,11 @@
|
||||
"${input:name}",
|
||||
"${input:categoryLibrary}"
|
||||
],
|
||||
"options": {
|
||||
"env": {
|
||||
"EDITOR": "code -r"
|
||||
}
|
||||
},
|
||||
"presentation": {
|
||||
"reveal": "never",
|
||||
"close": true
|
||||
|
||||
@@ -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
|
||||
@@ -51,5 +52,6 @@ category: {change_category}
|
||||
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 -r')
|
||||
|
||||
os.system(f"{editor} {change_note_file}")
|
||||
|
||||
Reference in New Issue
Block a user