**Update .gitignore and improve build.nu script**:

- Updated the `.gitignore` file to ignore Visual Studio's `.vs` directories.
- Modified the `update_dotnet_version` function in `build.nu` to enhance the regular expression used for parsing information from the `dotnet --info` command.

**Changes:**
1. **Updated .gitignore:**
   - Added patterns to ignore Visual Studio's `.vs` directories to keep the repository clean and reduce unnecessary files tracked by Git.

2. **Improved build.nu Script:**
   - Fixed an issue with the `nu build.nu publish` command under Windows 11, Visual Studio 2022, and .NET SDK 9.
   - Updated the regular expression in the `update_dotnet_version` function to correctly parse the version information from the `dotnet --info` output.

**Example Output of `dotnet --info`:**
```plaintext
.NET SDK:
 Version:           9.0.101
 Commit:            eedb237549
 Workload version:  9.0.100-manifests.4a280210
 MSBuild version:   17.12.12+1cce77968

[...]

Host:
  Version:      9.0.0
  Architecture: x64
  Commit:       9d5a6a9aa4
```
This commit is contained in:
Luc BOLOGNA 2024-12-26 13:02:06 +01:00
parent 02b6f526da
commit 2d87d3751d
2 changed files with 3 additions and 1 deletions

2
.gitignore vendored
View File

@ -147,3 +147,5 @@ orleans.codegen.cs
**/.idea/**/dynamic.xml
**/.idea/**/uiDesigner.xml
**/.idea/**/dbnavigator.xml
/.vs
/app/.vs

View File

@ -196,7 +196,7 @@ def update_dotnet_version []: nothing -> nothing {
mut dotnet_sdk_version = $meta_lines.3
mut dotnet_version = $meta_lines.4
let dotnet_data = (^dotnet --info) | collect | parse --regex '(?ms).?NET SDK:\s+Version:\s+(?P<sdkVersion>[0-9.]+).+Commit:\s+(?P<sdkCommit>[a-zA-Z0-9]+).+Host:\s+Version:\s+(?P<hostVersion>[0-9.]+).+Commit:\s+(?P<hostCommit>[a-zA-Z0-9]+)'
let dotnet_data = (^dotnet --info) | collect | parse --regex '(?ms).?(NET\s+SDK|SDK\s+\.NET)\s*:\s+Version:\s+(?P<sdkVersion>[0-9.]+).+Commit:\s+(?P<sdkCommit>[a-zA-Z0-9]+).+Host:\s+Version:\s+(?P<hostVersion>[0-9.]+).+Commit:\s+(?P<hostCommit>[a-zA-Z0-9]+)'
let sdk_version = $dotnet_data.sdkVersion.0
let host_version = $dotnet_data.hostVersion.0
let sdkCommit = $dotnet_data.sdkCommit.0