Skip to content

Commit

Permalink
add log statements to toolkit doc (#170)
Browse files Browse the repository at this point in the history
this allows to run
```nushell
use toolkit.nu
NU_LOG_LEVEL=DEBUG toolkit doc
```
  • Loading branch information
amtoine authored Jan 26, 2024
1 parent c1016e9 commit dad619b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions toolkit.nu
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use std repeat
use std log

# NOTE: this will likely get replaced by Nupm workspaces in the future
def list-modules-of-workspace []: nothing -> list<string> {
Expand Down Expand Up @@ -187,6 +188,7 @@ def document-command [
args: record<module_name: string, full_module_name_with_leading_path: string, root: path>
]: string -> string {
let command = $in
log debug $"documenting command `($command)`"

let command_file = $command
| str replace --all ' ' '-'
Expand Down Expand Up @@ -279,6 +281,7 @@ def document-module [
depth?: int = 0,
]: record<name: string, commands: list<string>, submodules: list<record>> -> nothing {
let module = $in
log debug $"documenting module `($module.name)`"

mkdir ($module.name | path basename)
cd ($module.name | path basename)
Expand Down

0 comments on commit dad619b

Please sign in to comment.