-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.ps1
35 lines (30 loc) · 958 Bytes
/
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
$CurrentFullPath = (Get-Location).Path
$svgDiagramSingleFileFullPath = Join-Path $CurrentFullPath "svgdiagram.js"
if (Test-Path $svgDiagramSingleFileFullPath) {
Remove-Item -Path $svgDiagramSingleFileFullPath
}
$JsFilesFolderFullPath = Join-Path $CurrentFullPath "src"
$JsFileNames =
'utils.js',
'svg.js',
'svg_extended.js',
'rnode.js',
'arrow.js',
'frame.js',
'panningAndZooming.js',
'initViewport.js',
'drawDiagram.js'
$JsFilesFullPaths =
$JsFileNames | Foreach-Object { Join-Path $JsFilesFolderFullPath $_ } | Where-Object { Test-Path $_ }
$JsFilesFullPaths |
Foreach-Object {
$JsFileContent = (Get-Content -Path $_)
if ($JsFileContent -eq $null) {
$JsFileContent = ''
}
else {
$JsFileContent = $JsFileContent.Replace("coordinateSystem", "// coordinateSystem") + "`r`n`r`n"
}
$JsFileContent | Out-File -FilePath $svgDiagramSingleFileFullPath -Append -Encoding utf8
}
" [Re-]Built: $svgDiagramSingleFileFullPath"