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:
parent
3c32fbfade
commit
6fe7713322
1 changed files with 3 additions and 3 deletions
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue