1
Fork 0
mirror of https://github.com/RGBCube/nu_scripts synced 2025-08-01 06:37:46 +00:00

add silent option to nu_msvs (#910)

I like to activate nu_msvs in my config by default and don't need a
message that tells me the command has been run when doing this. This
commit adds a --silent option so there's no message displayed when
running the command.
This commit is contained in:
sadguitarius 2024-07-22 12:08:46 -07:00 committed by GitHub
parent d64004f710
commit 770dfe6d4e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -71,7 +71,8 @@ def --env find_msvs [] {
export def --env activate [
--host (-h): string = x64, # Host architecture, must be x64 or x86 (case insensitive)
--target (-t): string = x64, # Target architecture, must be x64 or x86 (case insensitive)
--sdk (-s): string = latest # Version of Windows SDK, must be "latest" or a valid version string
--sdk (-s): string = latest, # Version of Windows SDK, must be "latest" or a valid version string
--silent,
] {
# I changed export-env {} to a custom command to avoid having export-env run when loading the module
# because:
@ -158,7 +159,9 @@ export def --env activate [
$'($env.MSVS_MSVC_ROOT)\lib\($ft)',
] | str join (char esep))
print "Activating Microsoft Visual Studio environment."
if (not $silent) {
print "Activating Microsoft Visual Studio environment."
}
load-env {
$env.PATH_VAR: $env_path,
INCLUDE: $env.MSVS_INCLUDE_PATH,