From ae35a58557359b051332813c6f6f3f30bf22cfc1 Mon Sep 17 00:00:00 2001 From: hustcer Date: Sat, 29 Jun 2024 14:58:15 +0800 Subject: [PATCH] fix plugin register --- dist/index.js | 3 +-- nu/register-plugins.nu | 3 +-- src/plugins.ts | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/dist/index.js b/dist/index.js index 4e116a6..d2ad690 100644 --- a/dist/index.js +++ b/dist/index.js @@ -68,8 +68,7 @@ def main [ let allPlugins = ls $nuDir | where name =~ nu_plugin print $'All plugins found in Nu directory:' print $allPlugins - print $'Is true: ($enablePlugins == true) ($enablePlugins == "true")' - let filteredPlugins = if ($enablePlugins | into bool) == 'true' { + let filteredPlugins = if $enablePlugins == "'true'" { $allPlugins } else { $allPlugins | filter {|it| $enablePlugins =~ ($it.name | path basename | split row . | first)} diff --git a/nu/register-plugins.nu b/nu/register-plugins.nu index 36a0bb9..aac42c6 100755 --- a/nu/register-plugins.nu +++ b/nu/register-plugins.nu @@ -31,8 +31,7 @@ def main [ let allPlugins = ls $nuDir | where name =~ nu_plugin print $'All plugins found in Nu directory:' print $allPlugins - print $'Is true: ($enablePlugins == true) ($enablePlugins == "true")' - let filteredPlugins = if ($enablePlugins | into bool) == 'true' { + let filteredPlugins = if $enablePlugins == "'true'" { $allPlugins } else { $allPlugins | filter {|it| $enablePlugins =~ ($it.name | path basename | split row . | first)} diff --git a/src/plugins.ts b/src/plugins.ts index 4b00c45..a283925 100644 --- a/src/plugins.ts +++ b/src/plugins.ts @@ -38,8 +38,7 @@ def main [ let allPlugins = ls $nuDir | where name =~ nu_plugin print $'All plugins found in Nu directory:' print $allPlugins - print $'Is true: ($enablePlugins == true) ($enablePlugins == "true")' - let filteredPlugins = if ($enablePlugins | into bool) == 'true' { + let filteredPlugins = if $enablePlugins == "'true'" { $allPlugins } else { $allPlugins | filter {|it| $enablePlugins =~ ($it.name | path basename | split row . | first)}