mirror of
https://github.com/RGBCube/nu_scripts
synced 2025-08-01 22:57:46 +00:00
use repeat
instead of string multiplication (#612)
This commit is contained in:
parent
36a45f28a3
commit
79fcd05525
1 changed files with 3 additions and 1 deletions
|
@ -1,6 +1,8 @@
|
||||||
|
use std repeat;
|
||||||
|
|
||||||
# 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 ("." * ($limit + 1))
|
cd ("." | repeat ($limit + 1) | str join)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue