Skip to content

Commit 46eb697

Browse files
bergmeisterTylerLeonhardt
authored andcommitted
Move temp folder into repo to avoid state that causes build errors from time to time when rebuilding locally (and packages have updated) (#903)
* Move temp folder into repo to avoid state that cannot be cleaned by cleaning the repo * Add new .tmp directory to .gitignore * Delete .tmp folder in Clean task
1 parent 8c66fa9 commit 46eb697

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ obj
55
objd
66
out/
77
tmp/
8+
.tmp
89
App_Data
910
*.user
1011
*.sln.cache

PowerShellEditorServices.build.ps1

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,10 @@ function Restore-NugetAsmForRuntime {
129129
[string]$TargetRuntime = $script:WindowsPowerShellFrameworkTarget
130130
)
131131

132-
$tmpDir = [System.IO.Path]::GetTempPath()
132+
$tmpDir = Join-Path $PSScriptRoot '.tmp'
133+
if (-not (Test-Path $tmpDir)) {
134+
New-Item -ItemType Directory -Path $tmpDir
135+
}
133136

134137
if (-not $DllName) {
135138
$DllName = "$PackageName.dll"
@@ -250,6 +253,7 @@ task SetupDotNet -Before Clean, Build, TestHost, TestServer, TestProtocol, Packa
250253
task Clean {
251254
exec { & $script:dotnetExe restore }
252255
exec { & $script:dotnetExe clean }
256+
Remove-Item $PSScriptRoot\.tmp -Recurse -Force -ErrorAction Ignore
253257
Remove-Item $PSScriptRoot\module\PowerShellEditorServices\bin -Recurse -Force -ErrorAction Ignore
254258
Remove-Item $PSScriptRoot\module\PowerShellEditorServices.VSCode\bin -Recurse -Force -ErrorAction Ignore
255259
Get-ChildItem -Recurse $PSScriptRoot\src\*.nupkg | Remove-Item -Force -ErrorAction Ignore

0 commit comments

Comments
 (0)