|
7 | 7 |
|
8 | 8 | echo "🔧 Setting up OSDCloudCustomBuilder development environment..." |
9 | 9 |
|
10 | | -# Set proper permissions for the workspace |
11 | | -sudo chown -R vscode:vscode /workspaces/OSDCloudCustomBuilder |
| 10 | +# Source environment detection |
| 11 | +if [ -f ".devcontainer/environment-detection.sh" ]; then |
| 12 | + echo "🔍 Loading environment detection..." |
| 13 | + source .devcontainer/environment-detection.sh |
| 14 | + detect_environment |
| 15 | +else |
| 16 | + echo "⚠️ Environment detection script not found, using defaults..." |
| 17 | + export CONTAINER_ENV="docker" |
| 18 | + export HOST_OS="linux" |
| 19 | + export WORKSPACE_TYPE="devcontainer" |
| 20 | +fi |
| 21 | + |
| 22 | +# Set proper permissions for the workspace (dynamic path) |
| 23 | +if [ "${WORKSPACE_TYPE}" = "devcontainer" ]; then |
| 24 | + sudo chown -R vscode:vscode "/workspaces/${PWD##*/}" 2>/dev/null || sudo chown -R vscode:vscode /workspaces/OSDCloudCustomBuilder 2>/dev/null || true |
| 25 | +else |
| 26 | + sudo chown -R vscode:vscode "${PWD}" 2>/dev/null || true |
| 27 | +fi |
12 | 28 |
|
13 | 29 | # Navigate to workspace |
14 | 30 | cd /workspaces/OSDCloudCustomBuilder |
15 | 31 |
|
| 32 | +# Configure Git based on environment |
| 33 | +echo "🔧 Configuring Git for environment..." |
| 34 | +case "${HOST_OS}" in |
| 35 | + "windows") |
| 36 | + git config --global core.autocrlf true |
| 37 | + git config --global core.eol crlf |
| 38 | + echo " Git configured for Windows host" |
| 39 | + ;; |
| 40 | + "macos"|"linux") |
| 41 | + git config --global core.autocrlf input |
| 42 | + git config --global core.eol lf |
| 43 | + echo " Git configured for Unix host" |
| 44 | + ;; |
| 45 | + *) |
| 46 | + git config --global core.autocrlf input |
| 47 | + git config --global core.eol lf |
| 48 | + echo " Git configured with default Unix settings" |
| 49 | + ;; |
| 50 | +esac |
| 51 | +git config --global init.defaultBranch main |
| 52 | + |
16 | 53 | # Restore .NET dependencies |
17 | 54 | if [ -f "OSDCloudCustomBuilder.csproj" ]; then |
18 | 55 | echo "📦 Restoring .NET packages..." |
|
0 commit comments