1
Fork 0
mirror of https://github.com/RGBCube/nu_scripts synced 2025-08-01 06:37: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:
Max Brown 2022-04-04 12:41:40 +01:00 committed by GitHub
parent 3660f37ea8
commit 577ad93638
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

10
filesystem/up.nu Executable file
View 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)
}