diff --git a/.gitignore b/.gitignore index 91c573d9c..3567788f8 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ obj objd out/ tmp/ +.tmp App_Data *.user *.sln.cache diff --git a/PowerShellEditorServices.build.ps1 b/PowerShellEditorServices.build.ps1 index 3739f8c27..2859f4a02 100644 --- a/PowerShellEditorServices.build.ps1 +++ b/PowerShellEditorServices.build.ps1 @@ -129,7 +129,10 @@ function Restore-NugetAsmForRuntime { [string]$TargetRuntime = $script:WindowsPowerShellFrameworkTarget ) - $tmpDir = [System.IO.Path]::GetTempPath() + $tmpDir = Join-Path $PSScriptRoot '.tmp' + if (-not (Test-Path $tmpDir)) { + New-Item -ItemType Directory -Path $tmpDir + } if (-not $DllName) { $DllName = "$PackageName.dll" @@ -250,6 +253,7 @@ task SetupDotNet -Before Clean, Build, TestHost, TestServer, TestProtocol, Packa task Clean { exec { & $script:dotnetExe restore } exec { & $script:dotnetExe clean } + Remove-Item $PSScriptRoot\.tmp -Recurse -Force -ErrorAction Ignore Remove-Item $PSScriptRoot\module\PowerShellEditorServices\bin -Recurse -Force -ErrorAction Ignore Remove-Item $PSScriptRoot\module\PowerShellEditorServices.VSCode\bin -Recurse -Force -ErrorAction Ignore Get-ChildItem -Recurse $PSScriptRoot\src\*.nupkg | Remove-Item -Force -ErrorAction Ignore