Skip to content

[Bug] extract_dir does not allow directory with - in its name #6484

@CrendKing

Description

@CrendKing

Bug Report

Current Behavior

Create a manifest with extract_dir having value like "a - b". The invoked 7z command will break the argument into two parts, like
7z.exe" x <snip> "-ir!a" "- b\*"
which is incorrect.

Expected Behavior

extract_dir should allow directory with - in its name.

Additional context/output

The bug is caused by this line:

$ArgumentList = $ArgumentList.ForEach({ $_ -replace '"' -split '(?<=(?<![:\w])[/-]\w+) | (?=[/-])' })
, which, according to the comment above, tries to sanitize command line switches. It makes sense for use cases where the function is invoked directly by user. However, in this case, the - is actually inside of a unbreakable string, not command line switch.

Possible Solution

Currently I have to comment out the line to make installation work.

System details

Windows version: 11

OS architecture: 64bit

PowerShell version: 7.5.3

Additional software: N/A

Scoop Configuration

I'm using the Scoop 0.5.3.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions