Skip to content

Commit 828f131

Browse files
committed
Updated build script to test for project asset files
Prevents the build failing if the code has never before been built, fixes #358.
1 parent c080d18 commit 828f131

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

PowerShellEditorServices.build.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ function NeedsRestore($rootPath) {
9494
# path (like "src" or "test") is greater than the number of
9595
# obj\project.assets.json files found under that path, implying
9696
# that those folders have not yet been restored.
97-
return (Get-ChildItem $rootPath).Length -gt (Get-ChildItem "$rootPath\*\obj\project.assets.json").Length
97+
$projectAssets = (Get-ChildItem "$rootPath\*\obj\project.assets.json")
98+
return ($projectAssets -eq $null) -or ((Get-ChildItem $rootPath).Length -gt $projectAssests.Length)
9899
}
99100

100101
task Restore -If { "Restore" -in $BuildTask -or (NeedsRestore(".\src")) -or (NeedsRestore(".\test")) } -Before Clean, Build, BuildHost, Test {

0 commit comments

Comments
 (0)