From 12483fac92155886fef390bd7c27a2e689c0f426 Mon Sep 17 00:00:00 2001 From: Reilly Wood <26268125+rgwood@users.noreply.github.com> Date: Wed, 1 Mar 2023 17:25:42 -0800 Subject: [PATCH] Use `for` instead of `each` in register-plugins.nu (#8284) Tiny change, just avoids printing `empty list` when running `register-plugins.nu`. Context: https://github.com/nushell/nushell/pull/8014#issuecomment-1440733867 --- register-plugins.nu | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/register-plugins.nu b/register-plugins.nu index 0c5dc5560f..dfeb6a2bba 100644 --- a/register-plugins.nu +++ b/register-plugins.nu @@ -9,14 +9,13 @@ def keep-plugin-executables [] { } # get list of all plugin files from their installed directory -ls ((which nu).path.0 | path dirname) -| where name =~ nu_plugin -| keep-plugin-executables -| each {|plugin| +let plugins = (ls ((which nu).path.0 | path dirname) | where name =~ nu_plugin | keep-plugin-executables) +for plugin in $plugins { print -n $"registering ($plugin.name), " nu -c $"register '($plugin.name)'" print "success!" } + # print helpful message print "\nplugins registered, please restart nushell"