-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.ps1
45 lines (34 loc) · 1017 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
36
37
38
39
40
41
42
43
44
45
Set-Alias sz "C:\Program Files\7-Zip\7z.exe"
$package = "at.megathorx.wsc_api.tar"
$files = ("package.xml", "aclOption.xml", "acpMenu.xml", "objectType.xml",
"objectTypeDefinition.xml", "option.xml", "userGroupOption.xml",
"userNotificationEvent.xml", "install.sql", "update_1.3.0.sql", "language")
if (!(Test-Path -Path build)) {
New-Item -ItemType directory -Path build
}
if (!(Test-Path -Path build_tmp)) {
New-Item -ItemType directory -Path build_tmp
}
if (Test-Path -Path files) {
cd files
sz a -ttar ../build_tmp/files.tar *
cd ..
}
if (Test-Path -Path templates) {
cd templates
sz a -ttar ../build_tmp/templates.tar *
cd ..
}
if (Test-Path -Path acptemplates) {
cd acptemplates
sz a -ttar ../build_tmp/acptemplates.tar *
cd ..
}
foreach ($file in $files) {
Copy-Item $file -Destination "build_tmp/." -Recurse
}
$filename = "../build/" + $package
cd build_tmp
sz a -ttar $filename *
cd ..
Remove-Item -Path build_tmp -Force -Recurse