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

use repeat instead of string multiplication (#612)

This commit is contained in:
baehyunsol 2023-09-21 20:20:49 +09:00 committed by GitHub
parent 36a45f28a3
commit 79fcd05525
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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)
}