Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
}
}
}
}
},
"postCreateCommand": "curl -fsSL https://vite.plus | bash"
// Use 'mounts' to make the cargo cache persistent in a Docker Volume.
// "mounts": [
// {
Expand Down
16 changes: 14 additions & 2 deletions packages/cli/install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -205,15 +205,27 @@ function Setup-NodeManager {

$binPath = "$InstallDir\bin"

# Explicit override via environment variable
if ($env:VITE_PLUS_NODE_MANAGER -eq "yes") {
Refresh-Shims -BinDir $BinDir
return "true"
} elseif ($env:VITE_PLUS_NODE_MANAGER -eq "no") {
return "false"
}

# Check if Vite+ is already managing Node.js (bin\node.exe exists)
if (Test-Path "$binPath\node.exe") {
# Already managing Node.js, just refresh shims
Refresh-Shims -BinDir $BinDir
return "already"
}

# Auto-enable on CI environment
if ($env:CI) {
# Auto-enable on CI or devcontainer environments
# CI: standard CI environment variable (GitHub Actions, Travis, CircleCI, etc.)
# CODESPACES: set by GitHub Codespaces (https://docs.github.com/en/codespaces)
# REMOTE_CONTAINERS: set by VS Code Dev Containers extension
# DEVPOD: set by DevPod (https://devpod.sh)
if ($env:CI -or $env:CODESPACES -or $env:REMOTE_CONTAINERS -or $env:DEVPOD) {
Refresh-Shims -BinDir $BinDir
return "true"
}
Expand Down
19 changes: 17 additions & 2 deletions packages/cli/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
# VITE_PLUS_VERSION - Version to install (default: latest)
# VITE_PLUS_HOME - Installation directory (default: ~/.vite-plus)
# NPM_CONFIG_REGISTRY - Custom npm registry URL (default: https://registry.npmjs.org)
# VITE_PLUS_NODE_MANAGER - Set to "yes" or "no" to skip interactive prompt (for CI/devcontainers)
# VITE_PLUS_LOCAL_TGZ - Path to local vite-plus.tgz (for development/testing)

set -e
Expand Down Expand Up @@ -442,15 +443,29 @@ setup_node_manager() {
vp_bin="$bin_dir/vp.exe"
fi

# Explicit override via environment variable
if [ "$VITE_PLUS_NODE_MANAGER" = "yes" ]; then
refresh_shims "$vp_bin"
NODE_MANAGER_ENABLED="true"
return 0
elif [ "$VITE_PLUS_NODE_MANAGER" = "no" ]; then
NODE_MANAGER_ENABLED="false"
return 0
fi

# Check if Vite+ is already managing Node.js (bin/node or bin/node.exe exists)
if [ -e "$bin_path/node" ] || [ -e "$bin_path/node.exe" ]; then
refresh_shims "$vp_bin"
NODE_MANAGER_ENABLED="already"
return 0
fi

# Auto-enable on CI environment
if [ -n "$CI" ]; then
# Auto-enable on CI or devcontainer environments
# CI: standard CI environment variable (GitHub Actions, Travis, CircleCI, etc.)
# CODESPACES: set by GitHub Codespaces (https://docs.github.com/en/codespaces)
# REMOTE_CONTAINERS: set by VS Code Dev Containers extension
# DEVPOD: set by DevPod (https://devpod.sh)
if [ -n "$CI" ] || [ -n "$CODESPACES" ] || [ -n "$REMOTE_CONTAINERS" ] || [ -n "$DEVPOD" ]; then
refresh_shims "$vp_bin"
NODE_MANAGER_ENABLED="true"
return 0
Expand Down
Loading