Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Simplify console output for plugin registering #113

Merged
merged 1 commit into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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