-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCake.ps1
39 lines (32 loc) · 951 Bytes
/
Cake.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<#
invokes cake build at the passed path
#>
function Invoke-PicassioCake
{
param (
[Parameter(Mandatory=$true)]
[ValidateNotNullOrEmpty()]
[string]
$Path,
[ValidateNotNullOrEmpty()]
[string]
$CakeFile = 'build.cake'
)
# ensure that cake is installed
Test-PicassioSoftware -Check 'cake -version' -Name 'cake' -ThrowIfNotExists | Out-Null
# ensure that the path to run cake exists
Test-PicassioPath -Path $Path -ThrowIfNotExists | Out-Null
# ensure that the cake script we're about to run exists
Test-PicassioPath -Path (Join-Path $Path $CakeFile) -ThrowIfNotExists | Out-Null
try
{
Push-Location $Path
Write-PicassioInfo "Running cake script: $($CakeFile)"
Invoke-PicassioCommand -Command "cake $($CakeFile)"
Write-PicassioSuccess 'Cake build complete'
}
finally
{
Pop-Location
}
}