1
Fork 0
mirror of https://github.com/RGBCube/nu_scripts synced 2025-08-02 07:07:46 +00:00

make up.nu much simpler (#391)

Now nu supports String multiplications!
This commit is contained in:
baehyunsol 2023-02-23 23:53:55 +09:00 committed by GitHub
parent d21cdfc0a5
commit 3b89c26a3f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,15 +1,6 @@
def up_inner [limit: int] {
mut x = []
for $e in 0..$limit { $x = $x ++ "." }
$x | str collect
}
# Go up a number of directories # Go up a number of directories
def-env up [ def-env up [
limit = 1: int # The number of directories to go up (default is 1) limit = 1: int # The number of directories to go up (default is 1)
] { ] {
cd ( cd ("." * ($limit + 1))
(up_inner $limit)
| into string
)
} }