diff --git a/ModernRonin.ProjectRenamer/Git.cs b/ModernRonin.ProjectRenamer/Git.cs index 9354373..9fcee1f 100644 --- a/ModernRonin.ProjectRenamer/Git.cs +++ b/ModernRonin.ProjectRenamer/Git.cs @@ -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 ."); @@ -50,4 +52,4 @@ string Read(string arguments) => void Run(string arguments, Action onNonZeroExitCode) => _executor.Tool(ToolGit, arguments, onNonZeroExitCode); } -} +} \ No newline at end of file diff --git a/ModernRonin.ProjectRenamer/release.history b/ModernRonin.ProjectRenamer/release.history index 96b3e1f..ae2d3ba 100644 --- a/ModernRonin.ProjectRenamer/release.history +++ b/ModernRonin.ProjectRenamer/release.history @@ -1,7 +1,9 @@  - 2.1.3 + 2.1.4 +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: diff --git a/README.md b/README.md index 07a43f5..d7236c8 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/push-package.ps1 b/push-package.ps1 index f351baa..d34e01c 100644 --- a/push-package.ps1 +++ b/push-package.ps1 @@ -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 \ No newline at end of file