Skip to content

chmod post-action broken by recent .Net Core changes #1547

@rmunn

Description

@rmunn

See https://github.com/dotnet/corefx/issues/24704#issuecomment-393750554 (and the whole issue discussion above that comment) for details, but basically, the meaning of UseShellExecute has changed. It no longer means "use /bin/sh"; now it means "use xdg-open". This results in errors like the following when the chmod post-action is used:

Processing post-creation actions...
xdg-open: unexpected argument '+x'
Try 'xdg-open --help' for more information.
Unable to apply permissions +x to "*.sh".
Post action failed.
Description: Make scripts executable
Manual instructions: Run 'chmod +x *.sh'

The only fix I can think of so far is to change the #1042 logic to run /bin/sh with arguments $"-c \"chmod {entry.Key} {file}\"" (note that the quotation marks after the -c MUST be double-quotation marks so that globs like *.sh will be expanded by the shell; single-quotes mean "Do not expand globs" to the Unix shell, which would not be the desired behavior here),

Also see #1028 (comment) and comments further down for even more details.

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