Skip to content

Commit

Permalink
Merge pull request #30 from ModernRonin/RefactorThePR
Browse files Browse the repository at this point in the history
Bugfix release
  • Loading branch information
ModernRonin authored May 3, 2021
2 parents a3f7fa8 + 284bf8c commit eac0c99
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 6 deletions.
6 changes: 4 additions & 2 deletions ModernRonin.ProjectRenamer/Git.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ void run(string arguments) =>

public string GetVersion() => Read("--version");

public void Move(string oldPath, string newPath) => Run($"mv \"{oldPath}\" \"{newPath}\"");
public void Move(string oldPath, string newPath) =>
Run($"mv {oldPath.EscapeForShell()} {newPath.EscapeForShell()}");

public void RollbackAllChanges() => Run("reset --hard HEAD", () => { });
public void StageAllChanges() => Run("add .");

Expand All @@ -50,4 +52,4 @@ string Read(string arguments) =>
void Run(string arguments, Action onNonZeroExitCode) =>
_executor.Tool(ToolGit, arguments, onNonZeroExitCode);
}
}
}
4 changes: 3 additions & 1 deletion ModernRonin.ProjectRenamer/release.history
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Version>2.1.3</Version>
<Version>2.1.4</Version>
<PackageReleaseNotes>
2.1.4:
* bugfix: fixed issue when paths contained whitespace; thanks to @jakubmaguza for the PR - the first contribution from anyone else :-)
2.1.3:
* bugfix: fixed a bug concerning nested solution folders; thanks to @Mike-E-angelo for reporting the bug
2.1.2:
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,11 @@ dotnet tool update --global ModernRonin.ProjectRenamer
When I publish a new version, I always post at [my blog](https://modernronin.github.io/) under the [renameproject tag](https://modernronin.github.io/tags/renameproject/), aside from updating this readme here.

### Release History
2.1.4:
* bugfix: fixed issue when paths contained whitespace; thanks to [@jakubmaguza](https://github.com/jakubmaguza) for the PR - the first contribution from anyone else :-)

2.1.3:
* bugfix: fixed a bug concerning nested solution folders; thanks to @Mike-E-angelo for reporting the bug
* bugfix: fixed a bug concerning nested solution folders; thanks to [@Mike-E-angelo](https://github.com/mike-e-angelo) for reporting the bug

2.1.2:
* bugfix: fixed another whitespace related scenario; thanks to [@sejohnson-at-griffis](https://github.com/sejohnson-at-griffis) for reporting the bug
Expand Down
20 changes: 18 additions & 2 deletions push-package.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
param ([parameter(mandatory)]$version)
param ($version)

if (-not $nugetApiKey) {Write-Host "You need to set the variable nugetApiKey"}
if (-not $nugetApiKey) {$nugetApiKey= $Env:NUGETAPIKEY}
if (-not $nugetApiKey)
{
Write-Host "You need to either set the powershell variable nugetApiKey or the environment variable NUGETAPIKEY before executing this script"
exit
}

if (-not $version)
{
[xml]$xml= Get-Content .\ModernRonin.ProjectRenamer\release.history
$version= $xml.Project.PropertyGroup.Version.ToString()
}
if (-not $version)
{
Write-Host "Something went wrong, could not read version from release.history"
exit
}

dotnet pack --configuration Release
dotnet nuget push .\ModernRonin.ProjectRenamer\nupkg\ModernRonin.ProjectRenamer.$version.nupkg -s https://api.nuget.org/v3/index.json --api-key $nugetApiKey

0 comments on commit eac0c99

Please sign in to comment.