Skip to content

Commit

Permalink
chore: Simplify console output for plugin registering
Browse files Browse the repository at this point in the history
  • Loading branch information
hustcer committed Oct 24, 2024
1 parent 77b6e29 commit 2228a84
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 18 deletions.
14 changes: 8 additions & 6 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 8 additions & 6 deletions nu/register-plugins.nu
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,18 @@
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.
] {

let useRegister = if $is_legacy { true } else { false }
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
Expand All @@ -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 \ /
Expand Down
14 changes: 8 additions & 6 deletions src/plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,18 @@ 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.
] {
let useRegister = if $is_legacy { true } else { false }
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
Expand All @@ -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 \ /
Expand Down

0 comments on commit 2228a84

Please sign in to comment.