Skip to content

Commit 86b76fd

Browse files
check for git (#810)
1 parent 59a2028 commit 86b76fd

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

PowerShellEditorServices.build.ps1

+4-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@ $script:TargetFrameworksParam = "/p:TargetFrameworks=\`"$(if (!$script:IsUnix) {
2222
$script:SaveModuleSupportsAllowPrerelease = (Get-Command Save-Module).Parameters.ContainsKey("AllowPrerelease")
2323
$script:BuildInfoPath = [System.IO.Path]::Combine($PSScriptRoot, "src", "PowerShellEditorServices.Host", "BuildInfo", "BuildInfo.cs")
2424

25-
# ignore changes to this file
26-
git update-index --assume-unchanged "$PSScriptRoot/src/PowerShellEditorServices.Host/BuildInfo/BuildInfo.cs"
25+
if (Get-Command git -ErrorAction SilentlyContinue) {
26+
# ignore changes to this file
27+
git update-index --assume-unchanged "$PSScriptRoot/src/PowerShellEditorServices.Host/BuildInfo/BuildInfo.cs"
28+
}
2729

2830
if ($PSVersionTable.PSEdition -ne "Core") {
2931
Add-Type -Assembly System.IO.Compression.FileSystem

0 commit comments

Comments
 (0)