Skip to content

fix du --exclude globbing bug#12093

Merged
WindSoilder merged 1 commit intonushell:mainfrom
fdncred:fix_du_globbing_bug
Mar 6, 2024
Merged

fix du --exclude globbing bug#12093
WindSoilder merged 1 commit intonushell:mainfrom
fdncred:fix_du_globbing_bug

Conversation

@fdncred
Copy link
Copy Markdown
Contributor

@fdncred fdncred commented Mar 6, 2024

Description

This PR fixes a globbing bug in the du command. The problem was that --exclude needed to be a NuGlob instead of a String. A variety of ways were tried to fix this, including spread operators and into glob but none of them worked. Here's the Discord Conversation that documents the attempts.

Before

 du $env.PWD -x crates/**
Error: nu::shell::cant_convert

  × Can't convert to string.
   ╭─[entry #1:1:16]
 1 │ du $env.PWD -x crates/**
   ·                ────┬────
   ·                    ╰── can't convert glob to string
   ╰────

After

 du $env.PWD -x crates/**
╭─#─┬────path────┬apparent─┬physical─┬───directories───┬files╮
 0  D:\nushell  55.6 MB  55.6 MB  [table 17 rows]      
╰───┴────────────┴─────────┴─────────┴─────────────────┴─────╯

User-Facing Changes

Tests + Formatting

After Submitting

Copy link
Copy Markdown
Contributor

@WindSoilder WindSoilder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! LGTM

@WindSoilder WindSoilder merged commit 2ee3538 into nushell:main Mar 6, 2024
@fdncred fdncred deleted the fix_du_globbing_bug branch March 6, 2024 22:33
@hustcer hustcer added this to the v0.92.0 milestone Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants