Compare commits

..

2 Commits

Author SHA1 Message Date
38fcc71ca3 nu: Add ctd command 2024-11-04 16:00:30 +01:00
da0e57ae22 Fix gitfixremote 2024-11-04 16:00:30 +01:00
3 changed files with 8 additions and 1 deletions

6
tree/.local/nu/cargo.nu Normal file
View File

@ -0,0 +1,6 @@
# Resolve path to the cargo target dir, including an optional subpath
def ctd [
path?: string
] {
$"($env.CARGO_TARGET_DIR)/($path)"
}

View File

@ -2,7 +2,8 @@ def gitfixremote [
--name: string = "origin",
] {
let url = (git remote get-url $name)
let parsed = ($url | parse --regex '(https://)?(?P<host>[^/]+)(/|:)(?P<owner>[^/]+)/(?P<repo>[^/\.]+)')
let parsed = ($url | parse --regex '(https://)?(\w*@)?(?P<host>[^/]+)(/|:)(?P<owner>[^/]+)/(?P<repo>[^/\.]+)')
if ($parsed | is-empty) {
print "Unparseable remote"
return

0
tree/.local/nu/readelf.nu Executable file → Normal file
View File