diff --git a/dist/index.js b/dist/index.js index bc45fe6..1a47e2a 100644 --- a/dist/index.js +++ b/dist/index.js @@ -48,6 +48,7 @@ e.exports=runParallel;const r=A(5092);function runParallel(e,t){let A,s,n;let o= def main [ enablePlugins: string, # Whether to enable or disable plugins. version: string, # The tag name or version of the release to use. + --debug, # Whether to enable debug mode. --is-legacy, # Whether to use the legacy plugin registration command for Nu 0.92.3 and below. ] { @@ -55,10 +56,10 @@ def main [ let nuDir = (which nu | get 0.path | path dirname) print $'enablePlugins: ($enablePlugins) of Nu version: ($version)' - print 'Output of (which nu):' - print (which nu) - print 'Directory contents:' - ls $nuDir | print + if $debug { + print 'Output of (which nu):'; print (which nu) + print 'Directory contents:'; ls $nuDir | print + } # print $nu # Create Nu config directory if it does not exist @@ -74,8 +75,9 @@ def main [ $allPlugins | filter {|it| $enablePlugins =~ ($it.name | path basename | split row . | first)} } - print $'Filtered plugins:' - print $filteredPlugins + if $debug { + print $'Filtered plugins:'; print $filteredPlugins + } $filteredPlugins | each {|plugin| let p = $plugin.name | str replace -a \ / diff --git a/nu/register-plugins.nu b/nu/register-plugins.nu index 95c7e07..47d712f 100755 --- a/nu/register-plugins.nu +++ b/nu/register-plugins.nu @@ -9,6 +9,7 @@ def main [ enablePlugins: string, # Whether to enable or disable plugins. version: string, # The tag name or version of the release to use. + --debug, # Whether to enable debug mode. --is-legacy, # Whether to use the legacy plugin registration command for Nu 0.92.3 and below. ] { @@ -16,10 +17,10 @@ def main [ let nuDir = (which nu | get 0.path | path dirname) print $'enablePlugins: ($enablePlugins) of Nu version: ($version)' - print 'Output of (which nu):' - print (which nu) - print 'Directory contents:' - ls $nuDir | print + if $debug { + print 'Output of (which nu):'; print (which nu) + print 'Directory contents:'; ls $nuDir | print + } # print $nu # Create Nu config directory if it does not exist @@ -35,8 +36,9 @@ def main [ $allPlugins | filter {|it| $enablePlugins =~ ($it.name | path basename | split row . | first)} } - print $'Filtered plugins:' - print $filteredPlugins + if $debug { + print $'Filtered plugins:'; print $filteredPlugins + } $filteredPlugins | each {|plugin| let p = $plugin.name | str replace -a \ / diff --git a/src/plugins.ts b/src/plugins.ts index eb8d5d9..00b7d65 100644 --- a/src/plugins.ts +++ b/src/plugins.ts @@ -16,6 +16,7 @@ const pluginRegisterScript = nu` def main [ enablePlugins: string, # Whether to enable or disable plugins. version: string, # The tag name or version of the release to use. + --debug, # Whether to enable debug mode. --is-legacy, # Whether to use the legacy plugin registration command for Nu 0.92.3 and below. ] { @@ -23,10 +24,10 @@ def main [ let nuDir = (which nu | get 0.path | path dirname) print $'enablePlugins: ($enablePlugins) of Nu version: ($version)' - print 'Output of (which nu):' - print (which nu) - print 'Directory contents:' - ls $nuDir | print + if $debug { + print 'Output of (which nu):'; print (which nu) + print 'Directory contents:'; ls $nuDir | print + } # print $nu # Create Nu config directory if it does not exist @@ -42,8 +43,9 @@ def main [ $allPlugins | filter {|it| $enablePlugins =~ ($it.name | path basename | split row . | first)} } - print $'Filtered plugins:' - print $filteredPlugins + if $debug { + print $'Filtered plugins:'; print $filteredPlugins + } $filteredPlugins | each {|plugin| let p = $plugin.name | str replace -a \ /