From 79fcd05525f2a79416b971b85147bb3e198f79e3 Mon Sep 17 00:00:00 2001 From: baehyunsol <47506131+baehyunsol@users.noreply.github.com> Date: Thu, 21 Sep 2023 20:20:49 +0900 Subject: [PATCH] use `repeat` instead of string multiplication (#612) --- sourced/filesystem/up.nu | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sourced/filesystem/up.nu b/sourced/filesystem/up.nu index 0872ec36..43a1ddaf 100755 --- a/sourced/filesystem/up.nu +++ b/sourced/filesystem/up.nu @@ -1,6 +1,8 @@ +use std repeat; + # Go up a number of directories def-env up [ limit = 1: int # The number of directories to go up (default is 1) ] { - cd ("." * ($limit + 1)) + cd ("." | repeat ($limit + 1) | str join) }