-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.ps1
41 lines (31 loc) · 1.19 KB
/
build.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
40
41
[CmdletBinding()]
Param(
[Parameter()]
[Switch]
$Build
)
process {
$root = Split-Path -Parent $MyInvocation.MyCommand.Definition
switch($true){
$Build {
$Output = Join-Path $root -ChildPath 'Output'
$CloudsmithFolder = Join-Path $Output -ChildPath 'PSCloudsmith'
if(Test-Path "$root\Output"){
Remove-Item "$root\Output\" -Recurse -Force
}
if(-not (Test-Path $Output)){
$null = New-Item $Output -ItemType Directory
}
if(-not (Test-Path $CloudsmithFolder)){
$null = New-Item $CloudsmithFolder -ItemType Directory
}
Get-ChildItem $root\src\public\ -Recurse -Filter *.ps1 | Foreach-Object {
Get-Content $_.FullName | Add-Content "$root\Output\PSCloudsmith\PSCloudsmith.psm1" -Force
}
Get-ChildItem $root\src\private\ -Recurse -Filter *.ps1 | Foreach-Object {
Get-Content $_.FullName | Add-Content "$root\Output\PSCloudsmith\PSCloudsmith.psm1" -Force
}
Copy-Item $root\PSCloudsmith.psd1 -Destination $CloudsmithFolder
}
}
}