Skip to content

Commit

Permalink
Make toolkits callable from anywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
NonlinearFruit committed Jan 11, 2025
1 parent 8abf4f6 commit 8f66b7f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion nvim/snippets/nu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ return {
fmt(
[[
def --wrapped main [...rest] {{
nu -c $'use toolkit.nu; toolkit ($rest | str join " ")'
const pathToSelf = path self
let nameOfSelf = $pathToSelf | path parse | get stem
nu -c $'use ($pathToSelf); ($nameOfSelf) ($rest | str join (" "))'
}}
]],
Expand Down
4 changes: 3 additions & 1 deletion toolkit.nu
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
def --wrapped main [...rest] {
nu -c $'use toolkit.nu; toolkit ($rest | str join " ")'
const pathToSelf = path self
let nameOfSelf = $pathToSelf | path parse | get stem
nu -c $'use ($pathToSelf); ($nameOfSelf) ($rest | str join (" "))'
}

export def update-readme [] {
Expand Down

0 comments on commit 8f66b7f

Please sign in to comment.