Skip to content

Commit 814ac43

Browse files
authored
fix(install): add DTVEM_ROOT support to PowerShell installer (#176)
1 parent 05e80a5 commit 814ac43

1 file changed

Lines changed: 18 additions & 2 deletions

File tree

install.ps1

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,19 @@
44
$ErrorActionPreference = "Stop"
55

66
$REPO = "dtvem/dtvem"
7-
$INSTALL_DIR = "$env:USERPROFILE\.dtvem\bin"
7+
8+
# Get dtvem root directory
9+
# Respects DTVEM_ROOT environment variable if set, otherwise uses default
10+
function Get-DtvemRoot {
11+
if ($env:DTVEM_ROOT) {
12+
return $env:DTVEM_ROOT
13+
}
14+
return "$env:USERPROFILE\.dtvem"
15+
}
16+
17+
$DTVEM_ROOT = Get-DtvemRoot
18+
$INSTALL_DIR = "$DTVEM_ROOT\bin"
19+
$SHIMS_DIR = "$DTVEM_ROOT\shims"
820

921
# This will be replaced with the actual version during release
1022
# Format: $DTVEM_RELEASE_VERSION = "1.0.0"
@@ -119,6 +131,10 @@ function Main {
119131
default { "amd64" }
120132
}
121133
Write-Info "Detected platform: windows-$ARCH"
134+
if ($env:DTVEM_ROOT) {
135+
Write-Info "Using custom DTVEM_ROOT: $DTVEM_ROOT"
136+
}
137+
Write-Info "Install directory: $INSTALL_DIR"
122138

123139
# Determine version to install
124140
$requestedVersion = $null
@@ -255,7 +271,7 @@ function Main {
255271

256272
& $dtvemPath init
257273
Write-Success "dtvem is ready to use!"
258-
Write-Info "Both ~/.dtvem/bin and ~/.dtvem/shims have been added to PATH"
274+
Write-Info "Both $INSTALL_DIR and $SHIMS_DIR have been added to PATH"
259275
}
260276
catch {
261277
Write-Warning-Custom "dtvem init failed - you may need to run it manually after restarting your terminal"

0 commit comments

Comments
 (0)