Skip to content
Merged
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
17 changes: 13 additions & 4 deletions modules/virtual_environments/nu_msvs/nu_msvs.nu
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
def --env find_msvs [] {
export-env {
$env.MSVS_BASE_PATH = $env.Path
$env.INCLUDE_BEFORE = if "INCLUDE" in $env { ($env.INCLUDE | split row (char esep)) } else { null }
$env.PATH_VAR = (if "Path" in $env { "Path" } else { "PATH" })

# According to https://github.com/microsoft/vswhere/wiki/Installing, vswhere should always be in this location.
Expand Down Expand Up @@ -161,8 +162,8 @@ export def --env activate [
}
load-env {
$env.PATH_VAR: $env_path,
INCLUDE: $env.MSVS_INCLUDE_PATH,
LIB: $lib_path
INCLUDE: ($env.MSVS_INCLUDE_PATH | append $env.INCLUDE_BEFORE),
LIB: $lib_path,
}

# Debug Information
Expand All @@ -181,12 +182,20 @@ export def --env deactivate [] {
$env.PATH_VAR: $env.MSVS_BASE_PATH,
}

hide-env INCLUDE
hide-env LIB
hide-env MSVS_BASE_PATH
hide-env MSVS_ROOT
hide-env MSVS_MSVC_ROOT
hide-env MSVS_MSDK_ROOT
hide-env MSVS_MSDK_VER
hide-env MSVS_INCLUDE_PATH
}

if $env.INCLUDE_BEFORE == null {
hide-env INCLUDE
} else {
load-env {
INCLUDE: ($env.INCLUDE_BEFORE | path expand | str join (char esep))
}
hide-env INCLUDE_BEFORE
}
}