nushell-plugins/scripts/install_full_nushell.nu
Jesús Pérez d9ef2f0d5b
Some checks failed
Build and Test / Validate Setup (push) Has been cancelled
Build and Test / Build (darwin-amd64) (push) Has been cancelled
Build and Test / Build (darwin-arm64) (push) Has been cancelled
Build and Test / Build (linux-amd64) (push) Has been cancelled
Build and Test / Build (windows-amd64) (push) Has been cancelled
Build and Test / Build (linux-arm64) (push) Has been cancelled
Build and Test / Security Audit (push) Has been cancelled
Build and Test / Package Results (push) Has been cancelled
Build and Test / Quality Gate (push) Has been cancelled
Nightly Build / Check for Changes (push) Has been cancelled
Nightly Build / Validate Setup (push) Has been cancelled
Nightly Build / Nightly Build (darwin-amd64) (push) Has been cancelled
Nightly Build / Nightly Build (darwin-arm64) (push) Has been cancelled
Nightly Build / Nightly Build (linux-amd64) (push) Has been cancelled
Nightly Build / Nightly Build (windows-amd64) (push) Has been cancelled
Nightly Build / Nightly Build (linux-arm64) (push) Has been cancelled
Nightly Build / Create Nightly Pre-release (push) Has been cancelled
Nightly Build / Notify Build Status (push) Has been cancelled
Nightly Build / Nightly Maintenance (push) Has been cancelled
chore: update all plugins to Nushell 0.111.0
- Bump all 18 plugins from 0.110.0 to 0.111.0
  - Update rust-toolchain.toml channel to 1.93.1 (nu 0.111.0 requires ≥1.91.1)

  Fixes:
  - interprocess pin =2.2.x → ^2.3.1 in nu_plugin_mcp, nu_plugin_nats, nu_plugin_typedialog
    (required by nu-plugin-core 0.111.0)
  - nu_plugin_typedialog: BackendType::Web initializer — add open_browser: false field
  - nu_plugin_auth: implement missing user_info_to_value helper referenced in tests

  Scripts:
  - update_all_plugins.nu: fix [package].version update on minor bumps; add [dev-dependencies]
    pass; add nu-plugin-test-support to managed crates
  - download_nushell.nu: rustup override unset before rm -rf on nushell dir replace;
    fix unclosed ) in string interpolation
2026-03-11 03:22:42 +00:00

139 lines
3.9 KiB
Plaintext

#!/usr/bin/env nu
# Simple, working Nushell 0.109+ installer
# Installs Nushell binary and plugins from local build directories
def main [
--install-dir (-i): string = "" # Installation directory
--interactive (-I) # Interactive mode
--verify # Verify after install
--test # Test mode (dry run)
] {
print "🚀 Nushell Distribution Installer"
print "=================================="
print ""
# Set installation directory
let install_dir = if ($install_dir == "") {
$"($env.HOME)/.local/bin"
} else {
$install_dir
}
print $"📍 Installation directory: ($install_dir)"
# Find binaries
let nu_binary = if ("./nushell/target/release/nu" | path exists) {
"./nushell/target/release/nu"
} else {
print "❌ Error: Nushell binary not found at ./nushell/target/release/nu"
print "Run 'just build-nushell' first"
exit 1
}
let plugins = (glob ./nu_plugin_*/target/release/nu_plugin_* | each {|p| {name: ($p | path basename), path: $p}})
print $"📦 Found components:"
print $" - Nushell binary: ($nu_binary | path basename)"
print $" - Plugins: (($plugins | length))"
($plugins | each {|p| print $" • ($p.name)"})
if $test {
print ""
print "🧪 Test mode (dry run) - no changes made"
print " Run without --test to actually install"
return
}
print ""
# Create directory
mkdir -p $install_dir
print $"✅ Created: ($install_dir)"
# Install Nushell
print ""
print "📥 Installing Nushell..."
cp $nu_binary $"($install_dir)/nu"
chmod +x $"($install_dir)/nu"
print $"✅ Installed: ($install_dir)/nu"
# Install plugins
if ($plugins | length) > 0 {
print ""
print "📥 Installing plugins..."
for plugin in $plugins {
cp $plugin.path $"($install_dir)/($plugin.name)"
chmod +x $"($install_dir)/($plugin.name)"
print $"✅ Installed: ($plugin.name)"
}
}
# Register plugins
print ""
print "📝 Registering plugins..."
let nu_exe = $"($install_dir)/nu"
let plugin_names = ($plugins | map {|p| $p.name})
for plugin_name in $plugin_names {
let plugin_path = $"($install_dir)/($plugin_name)"
try {
^$nu_exe -c $"plugin add ($plugin_path)"
print $"✅ Registered: ($plugin_name)"
} catch {|err|
print $"⚠️ Failed to register ($plugin_name): ($err.msg)"
}
}
# Summary
print ""
print "✨ Installation Complete!"
print ""
print "📋 Next steps:"
print $" 1. Add ($install_dir) to your PATH:"
print $" export PATH=\"($install_dir):${'$'}PATH\""
print $" 2. Verify installation:"
print $" ($install_dir)/nu -c \"version\""
print $" 3. Check registered plugins:"
print $" ($install_dir)/nu -c \"plugin list\""
if $verify {
print ""
print "🔍 Verifying installation..."
verify_installation $install_dir $plugin_names
}
}
def verify_installation [install_dir: string, plugins: list<string>] {
let nu_exe = $"($install_dir)/nu"
print ""
print "Verification Results:"
print "===================="
# Check Nushell
if ($nu_exe | path exists) {
try {
let version = (^$nu_exe -c "version")
print $"✅ Nushell: ($version)"
} catch {
print "❌ Nushell binary not executable"
}
} else {
print "❌ Nushell binary not found"
}
# Check plugins
for plugin in $plugins {
let plugin_path = $"($install_dir)/($plugin)"
if ($plugin_path | path exists) {
print $"✅ ($plugin): installed"
} else {
print $"❌ ($plugin): not found"
}
}
}
main