Skip to content

Commit addd6d0

Browse files
authored
Merge pull request #108 from nushell-prophet/style-iterations
refactor: iterative code style exploration
2 parents 1a3522c + 6330838 commit addd6d0

2 files changed

Lines changed: 9 additions & 7 deletions

File tree

numd/commands.nu

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -477,15 +477,17 @@ export def execute-intermediate-script [
477477
]: nothing -> string {
478478
let args = if $use_host_config {
479479
[
480-
...(if ($nu.env-path | path exists) { [--env-config $nu.env-path] } else { [] })
481-
...(if ($nu.config-path | path exists) { [--config $nu.config-path] } else { [] })
482-
...(if ($nu.plugin-path | path exists) { [--plugin-config $nu.plugin-path] } else { [] })
480+
[--env-config $nu.env-path]
481+
[--config $nu.config-path]
482+
[--plugin-config $nu.plugin-path]
483483
]
484+
| where {|i| $i.1 | path exists }
485+
| flatten
484486
} else {
485487
[-n]
486488
}
487489

488-
(^$nu.current-exe ...$args $intermed_script_path)
490+
^$nu.current-exe ...$args $intermed_script_path
489491
| if $print_block_results { tee { print } } else { }
490492
| complete
491493
| if $in.exit_code == 0 {

z_examples/2_numd_commands_explanations/numd_commands_explanations.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,8 @@ compute-change-stats $file $md_orig $md_res
221221
# => │ filename │ simple_markdown.md │
222222
# => │ nushell_blocks │ 3 │
223223
# => │ levenshtein_dist │ 248 │
224-
# => │ diff_lines │ --12 (-33.3%) │
225-
# => │ diff_words │ --24 (-30.8%) │
226-
# => │ diff_chars │ --163 (-32.5%) │
224+
# => │ diff_lines │ -12 (-33.3%)
225+
# => │ diff_words │ -24 (-30.8%)
226+
# => │ diff_chars │ -163 (-32.5%)
227227
# => ╰──────────────────┴────────────────────╯
228228
```

0 commit comments

Comments
 (0)