Skip to content

Formatting files using shfmt results in an empty file when shfmt can't parse the file #1162

Closed
@chris-reeves

Description

@chris-reeves

When formatting is enabled and run against a file that shfmt can't parse, the contents are replaced with an empty file. This is a result of improper handling when shfmt returns a non-zero exit status.

Originally reported by @David-Else in #1136 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions