[mod] 20250113

This commit is contained in:
2025-01-13 11:56:55 +08:00
parent 59d13e309d
commit 38d3e16095
71 changed files with 1384 additions and 154 deletions

View File

@@ -0,0 +1,54 @@
#!/bin/sh
script_file=$0
while [ -h "$script_file" ]; do
script_file=$(readlink $script_file)
done
basedir=$(dirname "$(echo "$script_file" | sed -e 's,\\,/,g')")
# This file is placed in a stable (version-independent) location
# and forwards to the currently installed version
# WSL detection borrowed from VS Code
IN_WSL=false
if [ -n "$WSL_DISTRO_NAME" ]; then
# $WSL_DISTRO_NAME is available since WSL builds 18362, also for WSL2
IN_WSL=true
else
WSL_BUILD=$(uname -r | sed -E 's/^[0-9.]+-([0-9]+)-Microsoft.*|.*/\1/')
if [ -n "$WSL_BUILD" ]; then
IN_WSL=true
fi
fi
VSCODE_PATH=$(cat "$basedir/vscode-path")
DEVCONTAINER_CLI_PATH=$script_file
REMOTE_CONTAINERS_PATH=
if [ -f "$basedir/remote-containers-path" ]; then
REMOTE_CONTAINERS_PATH=$(cat "$basedir/remote-containers-path")
if [ $IN_WSL = true ]; then
REMOTE_CONTAINERS_PATH=$(wslpath -u $REMOTE_CONTAINERS_PATH)
fi
if [ ! -f "$REMOTE_CONTAINERS_PATH/dev-containers-user-cli/cli.js" ]; then
REMOTE_CONTAINERS_PATH=
fi
fi
if [ -z "$REMOTE_CONTAINERS_PATH" ]; then
echo "Failed to determine Dev Containers path"
exit 1
fi
if [ $IN_WSL = true ]; then
export WSLENV="ELECTRON_RUN_AS_NODE/w:DEVCONTAINER_CLI_PATH/p:IN_WSL:WSL_DISTRO_NAME:$WSLENV"
CLI=$(wslpath -m "$REMOTE_CONTAINERS_PATH/dev-containers-user-cli/cli.js")
ELECTRON=$(wslpath -u "$VSCODE_PATH")
# TODO - piping to `cat` is a temporary workaround for the CRLF->LF conversion
# that occurs when calling Windows Electron binary from WSL
IN_WSL=$IN_WSL DEVCONTAINER_CLI_PATH="$DEVCONTAINER_CLI_PATH" ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" "$@" | cat
exit $?
else
ELECTRON="$VSCODE_PATH"
CLI=$REMOTE_CONTAINERS_PATH/dev-containers-user-cli/cli.js
DEVCONTAINER_CLI_PATH="$DEVCONTAINER_CLI_PATH" ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" "$@"
exit $?
fi

View File

@@ -0,0 +1,37 @@
@echo off
@REM This file is placed in a stable (version-independent) location
@REM and forwards to the currently installed version
setlocal
SET DEVCONTAINER_CLI_PATH=%~f0
SET VSCODE_PATH=
:vscode_path
@REM Load the Code.exe path
IF NOT exist "%~dp0vscode-path%" goto fail_vscode_path
set /p VSCODE_PATH=<"%~dp0vscode-path%"
IF exist "%VSCODE_PATH%" goto remote_container_path
:fail_vscode_path
echo Failed to determine VS Code path
exit 1
:remote_container_path
SET REMOTE_CONTAINERS_PATH=
@REM Check the remote-containers-path file
@REM This is a cache (and enables Dev Containers development)
IF NOT exist "%~dp0remote-containers-path%" goto fail_remote_container_path
set /p REMOTE_CONTAINERS_PATH=<"%~dp0remote-containers-path%"
IF exist "%REMOTE_CONTAINERS_PATH%\dev-containers-user-cli\cli.js" goto forwardcall
:fail_remote_container_path
echo Failed to determine Dev Containers path
exit 1
:forwardcall
set ELECTRON_RUN_AS_NODE=1
"%VSCODE_PATH%" "%REMOTE_CONTAINERS_PATH%\dev-containers-user-cli\\cli.js" %*
endlocal

View File

@@ -0,0 +1 @@
c:\Users\user\.vscode\extensions\ms-vscode-remote.remote-containers-0.394.0

View File

@@ -0,0 +1 @@
c:\Program Files\Microsoft VS Code\resources\app

View File

@@ -0,0 +1 @@
575e183e33173d7303a39d47bdbf96e3a596a3ba9842f1c99ce19d5868603d78

View File

@@ -0,0 +1 @@
C:\Program Files\Microsoft VS Code\Code.exe

View File

@@ -0,0 +1 @@
stable