ShAssocCheck 0.3.0

Verifies correct operation of .sh file association and fixes known bug in Git for Windows .sh pipe redirection.

Install-Package ShAssocCheck -Version 0.3.0
dotnet add package ShAssocCheck --version 0.3.0
<PackageReference Include="ShAssocCheck" Version="0.3.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ShAssocCheck --version 0.3.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Git for Windows and MSYS2 are capable of providing nearly seamless Bash/CoreUtils integration on Windows. This package verifies that integration is present, and reports developer-friendly diagnostic messages in cases where integration is missing or not behaving as-expected. It will also detect and automatically repair a known issue in Git for Windows integration. If you would like your Visual Studio projects to be robust against developers encountering mysterious build failures due to pipe redirection failures or missing .sh file associations, then add this NuGet dependency.

Keep in mind that this NuGet package normally doesn't do anything, except verify that .sh scripts are in fact working. If you have a controlled development environment where you can ensure everyone has Bash/CoreUtils properly installed, then there's really no need to use the ShAssocCheck NuGet Package.

Changes since 0.2.0

  • Fixed a packaging error that caused file to report as missing even when it wasn't

Usage tip

If you have a solution with many projects then it is a good idea to attach ShAssocCheck NuGet package to a special startup project in your solution that runs before anything else. Often times solutions will have such a project for the purpose of collecting git repository version information and this NuGet package is best added as a dependency there. If the solution doesn't have such a project, then probably it probably should have one.


Why use Bash / CoreUtils ?

In simple terms, CoreUtils and Bash provide a robust CLI toolset that accelerate software development.

  • well-documented POSIX-compliant system
  • compatible with Linux and Mac
    • eliminates need to have .sh for one platform and .cmd or .ps1 for another
    • Consistent newline behavior
  • robust long path name support
    • Path names up to 32,700 characters always work as expected
    • (both cmd and PowerShell are still limited to 260 chars)

How it Works

The script tests for operational .sh file associations by running a short .sh script and getting the result via pipe redirection. If it works, then the script does nothing else. If that check fails, the script proceeds to check sh_auto_file and see if it matches git-bash.exe. If so, it applies the Git for Windows association patch fix via a NSIS installer. The installer is used because it provides the Admin Elevated Rights profile required to modify file types and associations, and will be invoked only once after any Git for Windows install/update (due to GitWin overwritting our association with it's broken one).

Known Problems

Support for stand-alone MSYS2 is currently less than ideal. It's strongly recommended to use Git for Windows as it integrates far better with Windows shell and Explorer out-of-the-box.

Git for Windows and MSYS2 are capable of providing nearly seamless Bash/CoreUtils integration on Windows. This package verifies that integration is present, and reports developer-friendly diagnostic messages in cases where integration is missing or not behaving as-expected. It will also detect and automatically repair a known issue in Git for Windows integration. If you would like your Visual Studio projects to be robust against developers encountering mysterious build failures due to pipe redirection failures or missing .sh file associations, then add this NuGet dependency.

Keep in mind that this NuGet package normally doesn't do anything, except verify that .sh scripts are in fact working. If you have a controlled development environment where you can ensure everyone has Bash/CoreUtils properly installed, then there's really no need to use the ShAssocCheck NuGet Package.

Changes since 0.2.0

  • Fixed a packaging error that caused file to report as missing even when it wasn't

Usage tip

If you have a solution with many projects then it is a good idea to attach ShAssocCheck NuGet package to a special startup project in your solution that runs before anything else. Often times solutions will have such a project for the purpose of collecting git repository version information and this NuGet package is best added as a dependency there. If the solution doesn't have such a project, then probably it probably should have one.


Why use Bash / CoreUtils ?

In simple terms, CoreUtils and Bash provide a robust CLI toolset that accelerate software development.

  • well-documented POSIX-compliant system
  • compatible with Linux and Mac
    • eliminates need to have .sh for one platform and .cmd or .ps1 for another
    • Consistent newline behavior
  • robust long path name support
    • Path names up to 32,700 characters always work as expected
    • (both cmd and PowerShell are still limited to 260 chars)

How it Works

The script tests for operational .sh file associations by running a short .sh script and getting the result via pipe redirection. If it works, then the script does nothing else. If that check fails, the script proceeds to check sh_auto_file and see if it matches git-bash.exe. If so, it applies the Git for Windows association patch fix via a NSIS installer. The installer is used because it provides the Admin Elevated Rights profile required to modify file types and associations, and will be invoked only once after any Git for Windows install/update (due to GitWin overwritting our association with it's broken one).

Known Problems

Support for stand-alone MSYS2 is currently less than ideal. It's strongly recommended to use Git for Windows as it integrates far better with Windows shell and Explorer out-of-the-box.

Release Notes

Initial package release.

Dependencies

This package has no dependencies.

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
0.3.0 246 2/10/2018
0.2.0 204 2/8/2018