dprint / dprint-plugin-exec

Formatting plugin for dprint that formats code via other formatting CLI tools.
MIT License
21 stars 1 forks source link

Prefer resolving to PATHEXT extensions on Windows #25

Open dsherret opened 1 year ago

dsherret commented 1 year ago

The command in the config here (https://github.com/dprint/dprint-plugin-exec/issues/23#issuecomment-1464831839):

"exec": {
    "associations": [
      "**/*.{sh,bash}",
      "**/package.json"
    ],
    "prettier-package-json.associations": "**/package.json",
    "prettier-package-json": "node_modules/.bin/prettier-package-json"
  },

...has files prettier-package-json, prettier-package-json.cmd and prettier-package-json.ps1, but doesn't work on Windows:

Error formatting V:\scratch-npm\package.json. Message: Cannot start formatter process: %1 is not a valid Win32 application. (os error 193)

...unless the .cmd extension is provided. It should work cross platform and not require this extension.