Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor duplicate root stripping #100

Merged
merged 10 commits into from
Nov 21, 2023
Prev Previous commit
Next Next commit
fix path remove-prefix
  • Loading branch information
amtoine committed Nov 19, 2023

Verified

This commit was signed with the committer’s verified signature.
chenrui333 Rui Chen
commit 4f57df3e8aff2169208214d04903a847ac36f99a
2 changes: 1 addition & 1 deletion src/nu-git-manager/fs/path.nu
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ export def "path sanitize" []: path -> path {
#
# /!\ paths need to be sanitized /!\
export def "path remove-prefix" [prefix: path]: [path -> string, list<path> -> list<string>] {
str replace $prefix '' | str trim --left --char "/"
str replace --regex ('^' + $prefix + '/') ''
}

# remove the trailing `/` from a path or a list of paths