mirror of https://github.com/mongodb/mongo
SERVER-114396 raise error message from launch targets script (#44396)
GitOrigin-RevId: 33e1d740c49c9438a50e1b8e3a43923091f958dd
This commit is contained in:
parent
d8496c0a18
commit
e1ead5d9d9
|
|
@ -309,7 +309,7 @@
|
|||
"id": "runTargets",
|
||||
"command": "shellCommand.execute",
|
||||
"args": {
|
||||
"command": "buildscripts/vscode_launch_targets.sh 2> /dev/null",
|
||||
"command": "buildscripts/vscode_launch_targets.sh",
|
||||
"cwd": "${workspaceFolder}",
|
||||
"taskId": "runTargets",
|
||||
"rememberPrevious": true,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,28 @@
|
|||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
# Directory where you want the log to end up (VS Code is already setting cwd)
|
||||
ROOT_DIR=$(pwd)
|
||||
|
||||
tmp_log=$(mktemp)
|
||||
|
||||
cleanup() {
|
||||
status=$?
|
||||
if [[ -s "$tmp_log" ]]; then
|
||||
mv "$tmp_log" "$ROOT_DIR/.vscode_launch_targets.log"
|
||||
else
|
||||
rm -f "$tmp_log"
|
||||
rm -f "$ROOT_DIR/.vscode_launch_targets.log"
|
||||
fi
|
||||
exit $status
|
||||
}
|
||||
trap cleanup EXIT
|
||||
|
||||
# Save original stderr on fd 3
|
||||
exec 3>&2
|
||||
# Send stderr through tee: write to tmp_log and still to real stderr (fd 3)
|
||||
exec 2> >(tee "$tmp_log" >&3)
|
||||
|
||||
# 1) what we want to query
|
||||
QUERY=${1:-"attr(tags, \"mongo_binary\", //...) union attr(tags, \"mongo_unittest\", //...)"}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue