Skip to content

Commit 0f282ee

Browse files
committed
scripts: vscode: use script dir as fallback workspace
Use a relative directory to script dir for default workspace if workspace is not set. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
1 parent 80fa14e commit 0f282ee

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

scripts/vscode-task.sh

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,16 @@
55
# Simple helper script for vscode task support.
66
# Current vscode tasks have difficulty executing multiple commands.
77

8-
# check if Zephyr environment is set up
9-
if [ ! -z "$ZEPHYR_BASE" ]; then
10-
VENV_DIR="$ZEPHYR_BASE/.venv"
11-
echo "Using Zephyr environment at $ZEPHYR_BASE"
12-
elif [ ! -z "$SOF_WORKSPACE" ]; then
13-
VENV_DIR="$SOF_WORKSPACE/zephyr/.venv"
14-
echo "Using SOF/Zephyr environment at $SOF_WORKSPACE"
8+
# check if SOF workspace environment is set up
9+
if [ ! -z "$SOF_WORKSPACE" ]; then
10+
VENV_DIR="$SOF_WORKSPACE/.venv"
11+
echo "Using SOF environment at $SOF_WORKSPACE"
1512
else
16-
# fallback to the zephyr default from the getting started guide
17-
VENV_DIR="$HOME/zephyrproject/.venv"
18-
echo "Using default Zephyr environment at $VENV_DIR"
13+
# fallback to the script directory default path
14+
SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd)
15+
SOF_REPO=$(dirname "$SCRIPT_DIR")
16+
VENV_DIR="$SOF_REPO/../.venv"
17+
echo "Using default SOF environment at $VENV_DIR"
1918
fi
2019

2120
# start the virtual environment

0 commit comments

Comments
 (0)