Skip to content

Commit baf0dce

Browse files
committed
Refactor: Cleanup stdinFile immediately after compilation
1 parent 5f4dceb commit baf0dce

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

src/Compile-SourceScript/Public/Compile-SourceScript.ps1

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ function Compile-SourceScript {
179179
}
180180

181181
# Cleanup
182+
Remove-Item $stdInFile -Force
182183
Remove-Item $tempDir -Recurse -Force
183184

184185
if ($PSBoundParameters['SkipWrapper']) { "End of compilation." | Write-Host -ForegroundColor Yellow }
@@ -262,10 +263,6 @@ function Compile-SourceScript {
262263
}catch {
263264
Write-Error -Exception $_.Exception -Message $_.Exception.Message -Category $_.CategoryInfo.Category -TargetObject $_.TargetObject
264265
}finally {
265-
# Cleanup
266-
if ($stdInFile) {
267-
Remove-Item -Path $stdInFile -Force
268-
}
269266
"End of Compile-SourceScript." | Write-Host -ForegroundColor Cyan
270267
}
271268
}

0 commit comments

Comments
 (0)