Skip to content

Regression: disabling smart unpack causes Ouch to delete the whole directory #820

@amyspark

Description

@amyspark

Version

0.6.1

Description

#782 introduced unpacking straight into the target directory when --dir is specified.

In Windows, however, this does not work as expected. It tries deleting and recreating the target directory instead of just writing the files.

Current Behavior

❯ ouch decompress -d "$env:TEMP" D:\Downloads\libclang-20.1.2.tar.xz
Do you want to overwrite C:\Users\Amalia\AppData\Local\Temp\? [y/n/r]

(obviously n)

Expected Behavior

❯ ouch decompress -d "$env:TEMP" D:\Downloads\libclang-20.1.2.tar.xz
[INFO] "Users\\Amalia\\AppData\\Local\\Temp\\libclang-20.1.2" extracted. (0 B)
[INFO] "Users\\Amalia\\AppData\\Local\\Temp\\libclang-20.1.2/LICENSE.TXT" extracted. (15.14 kiB)
[INFO] "Users\\Amalia\\AppData\\Local\\Temp\\libclang-20.1.2/x64" extracted. (0 B)
[INFO] "Users\\Amalia\\AppData\\Local\\Temp\\libclang-20.1.2/x64/bin" extracted. (0 B)
[INFO] "Users\\v\\AppData\\Local\\Temp\\libclang-20.1.2/x64/bin/libclang.dll" extracted. (80.14 MiB)
[INFO] "Users\\Amalia\\AppData\\Local\\Temp\\libclang-20.1.2/x86" extracted. (0 B)
[INFO] "Users\\Amalia\\AppData\\Local\\Temp\\libclang-20.1.2/x86/bin" extracted. (0 B)
[INFO] "Users\\Amalia\\AppData\\Local\\Temp\\libclang-20.1.2/x86/bin/libclang.dll" extracted. (75.06 MiB)
[INFO] Successfully decompressed archive in C:\Users\Amalia\AppData\Local\Temp.
[INFO] Files unpacked: 8

Additional Information

Compare output of https://gitlab.freedesktop.org/amyspark/gstreamer-rs/-/jobs/74156023 to https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/jobs/76236804#L5522.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions