Skip to content

Commit 12574c3

Browse files
authored
update version number to 4.1.0 + add script to update the version number (#636)
1 parent 4b67af9 commit 12574c3

File tree

3 files changed

+23
-2
lines changed

3 files changed

+23
-2
lines changed

src/NuGetForUnity/Editor/Ui/NugetPreferences.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public class NugetPreferences : SettingsProvider
3434
/// <summary>
3535
/// The current version of NuGet for Unity.
3636
/// </summary>
37-
public const string NuGetForUnityVersion = "4.0.2";
37+
public const string NuGetForUnityVersion = "4.1.0";
3838

3939
private const float LabelPading = 5;
4040

src/NuGetForUnity/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "com.github-glitchenzo.nugetforunity",
33
"displayName": "NuGetForUnity",
4-
"version": "4.0.2",
4+
"version": "4.1.0",
55
"description": "A NuGet Package Manager for Unity",
66
"unity": "2018.4",
77
"keywords": [

tools/update-version-number.ps1

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
$ErrorActionPreference = 'Stop'
2+
3+
$packageJsonFilePath = 'src/NuGetForUnity/package.json'
4+
$nugetPreferencesCsFilePath = 'src/NuGetForUnity/Editor/Ui/NugetPreferences.cs'
5+
6+
$oldLocation = Get-Location
7+
Set-Location $PSScriptRoot/..
8+
9+
try {
10+
$newVersionNumber = Read-Host -Prompt "New version number"
11+
$packageJsonContent = Get-Content -Raw -Path $packageJsonFilePath
12+
$packageJsonContent = $packageJsonContent -replace '("version": ")[^"]+(")', "`${1}$newVersionNumber`${2}"
13+
Set-Content -Value $packageJsonContent -Path $packageJsonFilePath -Encoding utf8NoBOM -NoNewline
14+
15+
$nugetPreferencesCsFileContent = Get-Content -Raw -Path $nugetPreferencesCsFilePath
16+
$nugetPreferencesCsFileContent = $nugetPreferencesCsFileContent -replace '(public const string NuGetForUnityVersion = ")[^"]+(";)', "`${1}$newVersionNumber`${2}"
17+
Set-Content -Value $nugetPreferencesCsFileContent -Path $nugetPreferencesCsFilePath -Encoding utf8BOM -NoNewline
18+
}
19+
finally {
20+
Set-Location $oldLocation
21+
}

0 commit comments

Comments
 (0)