Skip to content

Commit

Permalink
PMC Tools: Work around dotnet/project-system#5895 (dotnet#22124)
Browse files Browse the repository at this point in the history
  • Loading branch information
bricelam committed Aug 19, 2020
1 parent 4b6bb4f commit 897dc03
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/EFCore.Tools/tools/EntityFrameworkCore.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -349,12 +349,15 @@ function Remove-Migration
# NB: -join is here to support ConvertFrom-Json on PowerShell 3.0
$result = (EF $dteProject $dteStartupProject $params $Args) -join "`n" | ConvertFrom-Json

$files = $result.migrationFile, $result.metadataFile, $result.snapshotFile
$files | ?{ $_ -ne $null } | %{
$projectItem = GetProjectItem $dteProject $_
if ($projectItem)
{
$projectItem.Remove()
if (!(IsCpsProject $dteProject) -or (GetCpsProperty $dteProject 'EnableDefaultItems') -ne 'true' -or (GetCpsProperty $dteProject 'EnableDefaultCompileItems') -ne 'true')
{
$files = $result.migrationFile, $result.metadataFile, $result.snapshotFile
$files | ?{ $_ -ne $null } | %{
$projectItem = GetProjectItem $dteProject $_
if ($projectItem)
{
$projectItem.Remove()
}
}
}
}
Expand Down

0 comments on commit 897dc03

Please sign in to comment.