From 72361694005a85013d921c0e467692d3e0b1def9 Mon Sep 17 00:00:00 2001 From: Bahex Date: Sun, 22 Dec 2024 06:34:25 +0300 Subject: [PATCH] Fix parsing errors for nushell nightly --- nupm/publish.nu | 4 ++-- nupm/status.nu | 2 +- nupm/utils/package.nu | 2 +- nupm/utils/registry.nu | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/nupm/publish.nu b/nupm/publish.nu index 37957b0..4ee035e 100644 --- a/nupm/publish.nu +++ b/nupm/publish.nu @@ -176,7 +176,7 @@ export def main [ } } -def guess-url [] -> string { +def guess-url []: nothing -> string { mut url = (do -i { ^git remote get-url origin | complete } | get stdout) if ($url | is-empty) { @@ -191,7 +191,7 @@ def guess-url [] -> string { $url | str trim } -def guess-revision [] -> string { +def guess-revision []: nothing -> string { mut revision = (do -i { ^git describe --tags --abbrev=0 | complete } | get stdout) diff --git a/nupm/status.nu b/nupm/status.nu index a63f74b..ba9624a 100644 --- a/nupm/status.nu +++ b/nupm/status.nu @@ -5,7 +5,7 @@ use utils/package.nu [open-package-file list-package-files] # Display status of a package export def main [ path?: path # path to the package -] -> record { +]: nothing -> record { let path = $path | default $env.PWD | path expand let pkg = open-package-file $path diff --git a/nupm/utils/package.nu b/nupm/utils/package.nu index 8586184..56337a9 100644 --- a/nupm/utils/package.nu +++ b/nupm/utils/package.nu @@ -33,7 +33,7 @@ export def open-package-file [dir: path] { # Lists files of a package # # This will be useful for file integrity checks -export def list-package-files [pkg_dir: path, pkg: record] -> list { +export def list-package-files [pkg_dir: path, pkg: record]: nothing -> list { let activation = match $pkg.type { 'module' => $'use ($pkg.name)' 'script' => { diff --git a/nupm/utils/registry.nu b/nupm/utils/registry.nu index 2d3fe09..4dcb552 100644 --- a/nupm/utils/registry.nu +++ b/nupm/utils/registry.nu @@ -15,7 +15,7 @@ export def search-package [ package: string # Name of the package --registry: string # Which registry to use (name or path) --exact-match # Searched package name must match exactly -] -> table { +]: nothing -> table { let registries = if (not ($registry | is-empty)) and ($registry in $env.NUPM_REGISTRIES) { # If $registry is a valid column in $env.NUPM_REGISTRIES, use that { $registry : ($env.NUPM_REGISTRIES | get $registry) }