mirror of
https://github.com/RGBCube/nu_scripts
synced 2025-08-01 22:57:46 +00:00
Up function (#199)
* Add up function. * Only works in config.nu * Simplify script, using nushell updir notation.
This commit is contained in:
parent
3660f37ea8
commit
577ad93638
1 changed files with 10 additions and 0 deletions
10
filesystem/up.nu
Executable file
10
filesystem/up.nu
Executable file
|
@ -0,0 +1,10 @@
|
||||||
|
def up_inner [limit: int] {
|
||||||
|
(for $e in 0..$limit { "." } | str collect)
|
||||||
|
}
|
||||||
|
|
||||||
|
# Go up a number of directories
|
||||||
|
def-env up [
|
||||||
|
limit: int # The number of directories to go up
|
||||||
|
] {
|
||||||
|
cd (up_inner $limit)
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue