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

change match to case-insensitive (#1128)

`micromamba 2.1.1` change the output of `micromamba info` to lower case.
Change the match to case-insensitive to make it work on version `2.1.1`
This commit is contained in:
KyQiao 2025-06-05 19:29:09 +08:00 committed by GitHub
parent 3c32fbfade
commit 6fe7713322
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -71,8 +71,8 @@ def --env load-conda-info-env [] {
try {
# Corrected syntax: Pass arguments as separate strings to run-external
let mi_info_lines = (run-external $cmd_base "info" | lines)
let base = ($mi_info_lines | where $it =~ "Base Environment" | parse "{key}: {value}" | get value | str trim | first)
let dirs_line = ($mi_info_lines | where $it =~ "Envs Directories" | first)
let base = ($mi_info_lines | where $it =~ "(?i)Base Environment" | parse "{key}: {value}" | get value | str trim | first)
let dirs_line = ($mi_info_lines | where $it =~ "(?i)Envs Directories" | first)
let dirs = if ($dirs_line | is-empty) { [] } else { $dirs_line | parse "{key}: {value}" | get value | str trim | split row " " }
# Corrected syntax: Pass arguments as separate strings to run-external
@ -336,4 +336,4 @@ def system-path [] {
# Helper to check if an environment variable exists
def has-env [name: string] {
$name in $env
}
}