From dc0c806a12938a017e7ba5b8affa461c1c44cd28 Mon Sep 17 00:00:00 2001 From: amtoine Date: Fri, 26 Jul 2024 09:56:43 +0200 Subject: [PATCH] swap `generate` arguments --- pkgs/nu-git-manager-sugar/nu-git-manager-sugar/github.nu | 4 ++-- pkgs/nu-git-manager/nu-git-manager/fs/dir.nu | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/nu-git-manager-sugar/nu-git-manager-sugar/github.nu b/pkgs/nu-git-manager-sugar/nu-git-manager-sugar/github.nu index 24d1430b..e55c4770 100644 --- a/pkgs/nu-git-manager-sugar/nu-git-manager-sugar/github.nu +++ b/pkgs/nu-git-manager-sugar/nu-git-manager-sugar/github.nu @@ -143,7 +143,7 @@ export def "gm gh query-api" [ if $no_paginate { http get ($base_url | update params.page 1 | url join) } else { - let res = generate 1 {|page| + let res = generate { |page| log debug $"pulling page ($page)" let resp = http get ($base_url | update params.page $page | url join) @@ -173,7 +173,7 @@ export def "gm gh query-api" [ error make --unspanned { msg: $err_msg } } } - } + } 1 $res | flatten } diff --git a/pkgs/nu-git-manager/nu-git-manager/fs/dir.nu b/pkgs/nu-git-manager/nu-git-manager/fs/dir.nu index 44cd7a51..72e913c5 100644 --- a/pkgs/nu-git-manager/nu-git-manager/fs/dir.nu +++ b/pkgs/nu-git-manager/nu-git-manager/fs/dir.nu @@ -4,7 +4,7 @@ use path.nu ["path sanitize"] # # /!\ this command will return sanitized paths /!\ export def clean-empty-directories-rec []: list -> list { - let deleted = generate $in {|directories| + let deleted = generate {|directories| let next = $directories | each {|it| rm --force $it @@ -19,7 +19,7 @@ export def clean-empty-directories-rec []: list -> list { } else { {out: $directories, next: $next} } - } + } $in $deleted | flatten }