Skip to content
Open
Show file tree
Hide file tree
Changes from 4 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
4 changes: 3 additions & 1 deletion src/cmd/list.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::nu::paths::NuPaths;
use crate::nupm_compat::schema::NUPM_IMPORT_ORIGIN;
use crate::state::lockfile::Lockfile;
use crate::state::lockfile::{Lockfile, BUNDLED_NU_ORIGIN};
use anyhow::Result;
use std::io::Write;
use std::path::Path;
Expand Down Expand Up @@ -36,6 +36,8 @@ fn execute_to(root: &Path, out: &mut dyn Write) -> Result<()> {
};
let origin_tag = if entry.origin.as_deref() == Some(NUPM_IMPORT_ORIGIN) {
" (nupm import)"
} else if entry.origin.as_deref() == Some(BUNDLED_NU_ORIGIN) {
" (bundled with Nu)"
} else {
""
};
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/nu_pin_offer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ where

pub fn install_pinned_nu_and_refresh(root: &Path, pin: &str) -> Result<()> {
setup::execute_nu(
&NuSetupArgs::install(Some(pin.to_string()), true, false, true),
&NuSetupArgs::install(Some(pin.to_string()), true, false, true, false),
root,
)
.with_context(|| format!("Failed to install managed Nu {pin}"))?;
Expand Down
21 changes: 20 additions & 1 deletion src/cmd/setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ pub struct NuSetupArgs {
#[arg(long)]
pub yes: bool,

/// Extract only the nu binary, skipping bundled plugins (polars, etc.)
#[arg(long)]
pub minimal: bool,

// COMPAT: remove in v0.3.0 — hidden backward-compat flags
#[arg(long, hide = true)]
pub remove: bool,
Expand Down Expand Up @@ -117,13 +121,20 @@ pub enum NuAction {

impl NuSetupArgs {
/// Construct args for installing a managed Nu (latest or pinned).
pub fn install(version: Option<String>, force: bool, skip_path: bool, yes: bool) -> Self {
pub fn install(
version: Option<String>,
force: bool,
skip_path: bool,
yes: bool,
minimal: bool,
) -> Self {
Self {
action: None,
version,
force,
skip_path,
yes,
minimal,
remove: false,
use_path: false,
use_existing: None,
Expand All @@ -144,6 +155,7 @@ impl NuSetupArgs {
force: false,
skip_path: false,
yes,
minimal: false,
remove: false,
use_path: false,
use_existing: None,
Expand All @@ -158,6 +170,7 @@ impl NuSetupArgs {
force: false,
skip_path: false,
yes,
minimal: false,
remove: false,
use_path: false,
use_existing: None,
Expand All @@ -172,6 +185,7 @@ impl NuSetupArgs {
force: false,
skip_path,
yes,
minimal: false,
remove: false,
use_path: false,
use_existing: None,
Expand All @@ -186,6 +200,7 @@ impl NuSetupArgs {
force: false,
skip_path: false,
yes,
minimal: false,
remove: false,
use_path: false,
use_existing: None,
Expand Down Expand Up @@ -308,6 +323,7 @@ fn execute_nu_impl_locked(args: &NuSetupArgs, root: &Path) -> Result<()> {
force: args.force,
skip_path: args.skip_path,
version: args.version.clone(),
minimal: args.minimal,
caller_consented_destructive: false,
is_tty: None,
};
Expand Down Expand Up @@ -451,6 +467,7 @@ fn execute_use_path(yes: bool, root: &Path, force: bool, opts: ExecuteUseOpts<'_
force: false,
skip_path: false,
version: None,
minimal: false,
// Hoist consent so register_existing_nu's inner PATH prompt is
// suppressed -- only valid because the merged prompt above
// collected consent for both the delete AND the PATH add.
Expand Down Expand Up @@ -545,6 +562,7 @@ fn execute_use_existing(
force: false,
skip_path: false,
version: None,
minimal: false,
// Hoist consent so register_existing_nu's inner PATH prompt is
// suppressed -- only valid because the merged prompt above
// collected consent for both the delete AND the PATH add.
Expand Down Expand Up @@ -1255,6 +1273,7 @@ mod tests {
force: false,
skip_path: false,
yes: true,
minimal: false,
remove: true,
use_path: false,
use_existing: None,
Expand Down
Loading
Loading