From 840cec89076e10a4001ec92a013b35928febbb8e Mon Sep 17 00:00:00 2001 From: Jun-te Kim Date: Sat, 15 Nov 2025 17:18:23 +0000 Subject: [PATCH] basic devcontainer all set up for frontend and backend --- .devcontainer/post-install.sh | 41 ++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/.devcontainer/post-install.sh b/.devcontainer/post-install.sh index d9fc3a9..7ad6ef8 100644 --- a/.devcontainer/post-install.sh +++ b/.devcontainer/post-install.sh @@ -1,27 +1,28 @@ -# #!/bin/bash -# poetry install; +#!/bin/bash +cd frontend && npm install; +cd .. && cd backend && poetry install; -# # Get the Poetry virtual environment path -# VENV_PATH=$(poetry env info --path 2>/dev/null) +# Get the Poetry virtual environment path +VENV_PATH=$(poetry env info --path 2>/dev/null) -# if [ -z "$VENV_PATH" ]; then -# echo "No Poetry environment found. Did you run 'poetry install'?" -# exit 1 -# fi +if [ -z "$VENV_PATH" ]; then + echo "No Poetry environment found. Did you run 'poetry install'?" + exit 1 +fi -# # Ensure VS Code settings directory exists -# SETTINGS_DIR="/home/vscode/.vscode-server/data/Machine" -# SETTINGS_FILE="$SETTINGS_DIR/settings.json" +# Ensure VS Code settings directory exists +SETTINGS_DIR="/home/vscode/.vscode-server/data/Machine" +SETTINGS_FILE="$SETTINGS_DIR/settings.json" -# mkdir -p "$SETTINGS_DIR" +mkdir -p "$SETTINGS_DIR" -# # If settings.json doesn't exist, create a default one -# if [ ! -f "$SETTINGS_FILE" ]; then -# echo "{}" > "$SETTINGS_FILE" -# fi +# If settings.json doesn't exist, create a default one +if [ ! -f "$SETTINGS_FILE" ]; then + echo "{}" > "$SETTINGS_FILE" +fi -# # Update VS Code settings to use the Poetry virtual environment -# jq --arg venv "$VENV_PATH/bin/python" '.["python.defaultInterpreterPath"] = $venv' \ -# "$SETTINGS_FILE" > "$SETTINGS_FILE.tmp" && mv "$SETTINGS_FILE.tmp" "$SETTINGS_FILE" +# Update VS Code settings to use the Poetry virtual environment +jq --arg venv "$VENV_PATH/bin/python" '.["python.defaultInterpreterPath"] = $venv' \ + "$SETTINGS_FILE" > "$SETTINGS_FILE.tmp" && mv "$SETTINGS_FILE.tmp" "$SETTINGS_FILE" -# echo "✅ Updated VS Code to use Poetry environment: $VENV_PATH" +echo "✅ Updated VS Code to use Poetry environment: $VENV_PATH"