Skip to content

armgit / cua

Public Imported from GitHub
0

Scale computer-use 2.0 with open-source drivers, cross-OS sandboxes, and benchmarks for training, evaluation, and data generation.

simplified post-install

Dillon DuPont2245b0e29ef6
diff --git a/.devcontainer/post-install.sh b/.devcontainer/post-install.sh
index 0d9a293d83..5292a2593a 100644
--- a/.devcontainer/post-install.sh
+++ b/.devcontainer/post-install.sh
@@ -1,14 +1,13 @@
#!/usr/bin/env bash
+WORKSPACE="/workspaces/cua"
+
# Setup .env.local
echo "PYTHON_BIN=python" > /workspaces/cua/.env.local
# Run /scripts/build.sh
./scripts/build.sh
-# Open VSCode .code-workspace file
-# https://gist.github.com/Kaptensanders/79da7c1547751fb43c75904e3110bbf9
-
# check for dependencies
if ! command -v xxd &> /dev/null; then
echo "xxd command not found, install with"
@@ -16,46 +15,7 @@ if ! command -v xxd &> /dev/null; then
exit 1
fi
-DEVCONTAINER_JSON="$PWD/.devcontainer/devcontainer.json"
-CODE_WS_FILE=$(ls $PWD/*.code-workspace 2>/dev/null)
-
-if [ ! -f "$DEVCONTAINER_JSON" ];then
-
- # open code without container
-
- if [ -f "$CODE_WS_FILE" ]; then
- echo "Opening vscode workspace from $CODE_WS_FILE"
- code $CODE_WS_FILE
- else
- echo "Opening vscode in current directory"
- code .
- fi
- exit 0
-fi
-
-# open devcontainer
-if command -v wslpath >/dev/null 2>&1; then
- HOST_PATH=$(echo $(wslpath -w $PWD) | sed -e 's,\\,\\\\,g')
-else
- # Not on WSL, fallback for macOS/Linux
- HOST_PATH="$PWD"
-fi
-WORKSPACE="/workspaces/$(basename $PWD)"
-
-URI_SUFFIX=
-if [ -f "$CODE_WS_FILE" ]; then
- # open workspace file
- URI_TYPE="--file-uri"
- URI_SUFFIX="$WORKSPACE/$(basename $CODE_WS_FILE)"
- echo "Opening vscode workspace file within devcontainer"
-else
- URI_TYPE="--folder-uri"
- URI_SUFFIX="$WORKSPACE"
- echo "Opening vscode within devcontainer"
-fi
-
-URI="{\"hostPath\":\"$HOST_PATH\",\"configFile\":{\"\$mid\":1,\"path\":\"$DEVCONTAINER_JSON\",\"scheme\":\"vscode-fileHost\"}}"
-URI_HEX=$(echo "${URI}" | xxd -c 0 -p)
-
+CODE_WS_FILE="$WORKSPACE/.vscode/py.code-workspace"
export code="$(ls /vscode/vscode-server/bin/*/*/bin/remote-cli/code 2>/dev/null | head -n 1)"
-"$code" ${URI_TYPE}="vscode-remote://dev-container%2B${URI_HEX}${URI_SUFFIX}" &
\ No newline at end of file
+
+"$code" $CODE_WS_FILE &