-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.ps1
54 lines (42 loc) · 1.74 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
42
43
44
45
46
47
48
49
50
51
52
53
if ($Env:APPVEYOR) {
$BuildFolder = $env:APPVEYOR_BUILD_FOLDER
} else {
$BuildFolder = $PSScriptRoot
}
$powerShellGet = Import-Module PowerShellGet -PassThru -ErrorAction Ignore
if ($powerShellGet.Version -lt ([Version]'1.6.0')) {
Install-Module PowerShellGet -Scope CurrentUser -Force -AllowClobber
Import-Module PowerShellGet -Force
}
Set-Location $BuildFolder
$OutputPath = "$BuildFolder\output\UniversalDashboard.Sparklines"
Remove-Item -Path $OutputPath -Force -ErrorAction SilentlyContinue -Recurse
Remove-Item -Path "$BuildFolder\public" -Force -ErrorAction SilentlyContinue -Recurse
New-Item -Path $OutputPath -ItemType Directory
npm install
npm run build
Copy-Item $BuildFolder\public\sparklines.*.bundle.js $OutputPath
Copy-Item $BuildFolder\UniversalDashboard.Sparklines.psm1 $OutputPath
$Version = "0.1.1"
$manifestParameters = @{
Path = "$OutputPath\UniversalDashboard.Sparklines.psd1"
Author = "Adam Driscoll"
CompanyName = "Ironman Software, LLC"
Copyright = "2017 Ironman Software, LLC"
RootModule = "UniversalDashboard.Sparklines.psm1"
Description = "Sparklines component for PowerShell Universal Dashboard."
ModuleVersion = $version
Tags = @("universaldashboard", "sparklines")
ReleaseNotes = "Initial release"
LicenseUri = "https://github.com/ironmansoftware/ud-sparklines/blob/master/LICENSE"
ProjectUri = "https://github.com/ironmansoftware/ud-sparklines"
FunctionsToExport = @("New-UDSparkline")
CmdletsToExport = @()
RequiredModules = @("UniversalDashboard")
}
New-ModuleManifest @manifestParameters
if ($prerelease -ne $null) {
Update-ModuleManifest -Path "$OutputPath\UniversalDashboard.Sparklines.psd1" -Prerelease $prerelease
} else {
Update-ModuleManifest -Path "$OutputPath\UniversalDashboard.Sparklines.psd1"
}