Skip to content

Commit

Permalink
update version number to 4.1.0 + add script to update the version num…
Browse files Browse the repository at this point in the history
…ber (#636)
  • Loading branch information
JoC0de authored Apr 6, 2024
1 parent 4b67af9 commit 12574c3
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/NuGetForUnity/Editor/Ui/NugetPreferences.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class NugetPreferences : SettingsProvider
/// <summary>
/// The current version of NuGet for Unity.
/// </summary>
public const string NuGetForUnityVersion = "4.0.2";
public const string NuGetForUnityVersion = "4.1.0";

private const float LabelPading = 5;

Expand Down
2 changes: 1 addition & 1 deletion src/NuGetForUnity/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "com.github-glitchenzo.nugetforunity",
"displayName": "NuGetForUnity",
"version": "4.0.2",
"version": "4.1.0",
"description": "A NuGet Package Manager for Unity",
"unity": "2018.4",
"keywords": [
Expand Down
21 changes: 21 additions & 0 deletions tools/update-version-number.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
$ErrorActionPreference = 'Stop'

$packageJsonFilePath = 'src/NuGetForUnity/package.json'
$nugetPreferencesCsFilePath = 'src/NuGetForUnity/Editor/Ui/NugetPreferences.cs'

$oldLocation = Get-Location
Set-Location $PSScriptRoot/..

try {
$newVersionNumber = Read-Host -Prompt "New version number"
$packageJsonContent = Get-Content -Raw -Path $packageJsonFilePath
$packageJsonContent = $packageJsonContent -replace '("version": ")[^"]+(")', "`${1}$newVersionNumber`${2}"
Set-Content -Value $packageJsonContent -Path $packageJsonFilePath -Encoding utf8NoBOM -NoNewline

$nugetPreferencesCsFileContent = Get-Content -Raw -Path $nugetPreferencesCsFilePath
$nugetPreferencesCsFileContent = $nugetPreferencesCsFileContent -replace '(public const string NuGetForUnityVersion = ")[^"]+(";)', "`${1}$newVersionNumber`${2}"
Set-Content -Value $nugetPreferencesCsFileContent -Path $nugetPreferencesCsFilePath -Encoding utf8BOM -NoNewline
}
finally {
Set-Location $oldLocation
}

0 comments on commit 12574c3

Please sign in to comment.