dotfiles
bugabingas dorkfiles
owned by bugabinga
fix nushell deprecated string commands
fb85e7fffd7fcf781abedd6a48e763ba55dea9ac
Oliver Jan Krylow <oliver@bugabinga.net> ·
unsigned
Browse filesCompare with HEAD
Changed files (6)
nugu/linux_console.nu
Modified60 60 def strip-hash [hex: string] {
61 - $hex | str trim | str replace --regex
'^#' '' | str downcase
61 + $hex | str trim | str replace --regex
'^#' '' | str lowercase
64 64 def hex-index [index: int] {
113 113 if not (which mise | is-empty) {
114 114 mkdir (
$nu.vendor-autoload-dirs | last)
115 - ^mise activate nu | save --force (
$nu.vendor-autoload-dirs | last | path join
'mise.nu')
115 + ^mise activate nu | str replace --all
'str upcase' 'str uppercase' | str replace --all
'str downcase' 'str lowercase' | save --force (
$nu.vendor-autoload-dirs | last | path join
'mise.nu')
118 118 if not (which niri | is-empty) {
nushell/modules/git.nu
Modified 351 351 def add-candidate-matches [candidate: record, query: string] {
352 - let q = (
$query | str downcase)
353 - let branch = (
$candidate.branch | str downcase | str contains
$q)
354 - let base = (
$candidate.base | str downcase | str contains
$q)
355 - let display = (
$candidate.display | str downcase | str contains
$q)
352 + let q = (
$query | str lowercase)
353 + let branch = (
$candidate.branch | str lowercase | str contains
$q)
354 + let base = (
$candidate.base | str lowercase | str contains
$q)
355 + let display = (
$candidate.display | str lowercase | str contains
$q)
356 356 $branch or
$base or
$display nushell/modules/minimax.nu
Modified124 124 def parse-voice-gender [voice_name: string] {
125 - let name_lower = (
$voice_name | str downcase)
125 + let name_lower = (
$voice_name | str lowercase)
126 126 let female_markers = [
"girl",
"lady",
"woman",
"queen",
"sister",
"mother",
"wife",
"aunt",
"narrator",
"host",
"hostess",
"antie",
"belle",
"maiden"]
127 127 let male_markers = [
"man",
"boy",
"father",
"husband",
"king",
"brother",
"uncle",
"bloke",
"guy",
"dude",
"fellow",
"lad",
"gentleman"]
128 128 if (
$female_markers | any { |m|
$name_lower | str contains
$m }) {
nushell/modules/syncthing.nu
Modified10 10 merge ( to_original
$conflict )
$conflict 11 11 let input = ( input $
"Merge successful? \((ansi pb)Y(ansi reset)/n\) \n" )
12 - let sanitize = (
$input | str trim | str downcase | str substring
0..
1 )
12 + let sanitize = (
$input | str trim | str lowercase | str substring
0..
1 )
13 13 if (
$sanitize | is-empty) or
$sanitize ==
'y' {
14 14 rm --verbose --interactive
$conflict nushell/modules/zai.nu
Modified58 - print $
"($c)($plan | str upcase) Plan($e)" 58 + print $
"($c)($plan | str uppercase) Plan($e)" 60 60 let tokens =
$limits |
where kind == TOKENS_LIMIT
61 61 if $tokens != [] { print
""; print $
"($c)Tokens($e) LLM quota";
$tokens |
each {|r| show_limit
$r $d null } }