Skip to content

Desktop fails to run pre-commit hooks on node 16+ #12562

@ImRodry

Description

@ImRodry

Describe the bug

On Windows systems with WSL installed, GitHub desktop will run pre-commit scripts on WSL instead of running them in PowerShell regardless of which shell the user has picked to use. This results in the scripts looking for windows locations that don't exist on WSL.

Version & OS

Version 2.9.0 on Windows 10 21H1 build 19043.1081 running with WSL 2 on Ubuntu 20.04

Steps to reproduce the behavior

  1. Make some changes to a file in a project with a pre-commit script (I'm using the npm package husky which installs these)
  2. Add a commit message and try to commit
  3. You should get the following error

Expected behavior

GitHub desktop runs the pre-commit scripts on windows PowerShell, just like git does (tested this)

Actual behavior

The scripts are run on WSL which causes errors

Screenshots

image
(this path is correct for my system but may be different on others)

Logs

This log has the error multiple times, which should help.
2021-07-03.desktop.production.log

Additional context

Got this error on the repositories discordjs/discord.js and discordjs/builders (forks of them) so you can try committing on these to see if you get the same errors. I also believe this issue should have relatively high priority since I am incapable of committing through my PC (unless I use git, which is more limited on some things and harder for me)

Metadata

Metadata

Assignees

No one assigned

    Labels

    windowsIssues specific Desktop usage on Windows

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions