From 3b89c26a3f4ba10c8994c6f74bf00969c0f9f235 Mon Sep 17 00:00:00 2001 From: baehyunsol <47506131+baehyunsol@users.noreply.github.com> Date: Thu, 23 Feb 2023 23:53:55 +0900 Subject: [PATCH] make `up.nu` much simpler (#391) Now nu supports String multiplications! --- filesystem/up.nu | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/filesystem/up.nu b/filesystem/up.nu index ef94b47..0872ec3 100755 --- a/filesystem/up.nu +++ b/filesystem/up.nu @@ -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 def-env up [ limit = 1: int # The number of directories to go up (default is 1) ] { - cd ( - (up_inner $limit) - | into string - ) + cd ("." * ($limit + 1)) }