Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,22 @@

## Quickstart

### `git`

```nushell no-run
> git clone https://github.com/nushell-prophet/dotnu; cd dotnu
> use dotnu
```

### `nupm`
```
nupm install https://github.com/nushell-prophet/dotnu --git
# if nupm modules are not in `NU_LIB_DIRS`:
$env.NU_LIB_DIRS ++= [ ($env.NUPM_HOME | path join "modules") ]

use dotnu
```

## Embeds — keeping examples in sync

`dotnu` lets you write **literate Nushell**: ordinary Nushell scripts that include the real command output right after each pipeline ending in `| print $in`. See the [capture example](/dotnu-capture.nu) to grasp the idea quickly.
Expand Down
6 changes: 3 additions & 3 deletions dotnu/commands.nu
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ export def --env 'embeds-capture-stop' []: nothing -> nothing {

#### helpers
# they used to be separately here from the main code, but I want to experiment with structure
# so all the commands are in one file now, and all are exported, to be availible in my scripts
# so all the commands are in one file now, and all are exported, to be available in my scripts
# that can use this file commands with 'use ..', though main commands are exported in mod.nu

export def 'get-dotnu-capture-path' [] {
Expand Down Expand Up @@ -374,7 +374,7 @@ export def check-clean-working-tree [
error make --unspanned {
msg: (
"Working tree isn't empty. Please commit or stash changed files, " +
"or use `--no-git-check` flag. Uncommited files:\n" + $git_status
"or use `--no-git-check` flag. Uncommitted files:\n" + $git_status
)
}
}
Expand Down Expand Up @@ -556,7 +556,7 @@ export def 'module-commands-code-to-record' [
| into record
}

# prepare pairs of substituions of old results and new results
# prepare pairs of substitutions of old results and new results
export def format-substitutions [
$examples
$command_description
Expand Down
2 changes: 0 additions & 2 deletions dotnu/mod.nu
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,3 @@ export use commands.nu [
"module-commands-code-to-record"
"set-x"
]

use ('..' | path join tests nupm utils dirs.nu) find-root
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried a conditional alternative (since tests aren't added on nupm install) but there doesn't seem to be a way to invoke use conditionally, however find-root wasn't actually used in the dotnu module.

2 changes: 1 addition & 1 deletion tests/nupm/utils/misc.nu
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export module url {
export def update-name [new_name: string]: string -> string {
url parse
| update path {|url|
# skip the first '/' and replace last elemnt with the new name
# skip the first '/' and replace last element with the new name
let parts = $url.path | path split | skip 1 | drop 1
$parts | append $new_name | str join '/'
}
Expand Down