-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCompile.ps1
152 lines (142 loc) · 5.7 KB
/
Compile.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# Onur Zobi - 02/2019
#
function PAUSE{
write-host "Paused! Press Enter to continue..." -foregroundcolor Red
read-host
}
# DP
Write-Host "
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMM MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMM MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMM MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMM MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMM MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMM MMMMMMMMMMMMMMMMMM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MMMMMMMMMMMMMMMMMM MMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM MMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM MMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM MMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM MMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
" -foregroundcolor Red -backgroundcolor White
if (Test-Path .\_TEMP ) {
Remove-Item -path .\_TEMP -recurse -force
}
Write-Host Welcome! -foregroundcolor Magenta
Write-Host
# Selection PDF, WEB, or ALL
Write-Host "Select to compile" -foregroundcolor DarkCyan
Write-Host "1. PDF"
Write-Host "2. Website"
Write-Host "3. BOTH"
Write-Host
$num1 = Read-Host "Enter the number"
Write-Host
# Selection of Content
$list = Get-ChildItem -Path ./Contents -Attributes Directory
Write-Host "Select content from the list" -foregroundcolor DarkCyan
$k=1;
foreach ($file in $list) {
Write-Host "$k. $file"
Add-Member -InputObject $file -MemberType NoteProperty -Name "Type" -Value $file.Name.Split("_")[0]
$k++
}
Write-Host "$k. ALL"
Write-Host
$num2 = Read-Host "Enter the number"
Write-Host
Write-Host
# Compile Selection
switch ( $num1 ){
"1" { # Compile PDF
if($num2 -eq $k){ # Complete List
foreach ($file in $list) {
$folderName=$file.Name
Write-Host Compiling $file.Name PDF -foregroundcolor DarkCyan
Write-Host
(.\Resources\Compile_PDF.ps1)
}
PAUSE
} else{ # Selection
$folderName=$list[$num2-1].Name
Write-Host Compiling $list[$num2-1].Name PDF -foregroundcolor DarkCyan
Write-Host
(.\Resources\Compile_PDF.ps1)
PAUSE
}
break
}
"2" { # Compile Website
if($num2 -eq $k){ # Complete List
foreach ($file in $list) {
$folderName=$file.Name
$configName="config-"+$file.Type+".toml"
Write-Host Compiling $file.Name WEB -foregroundcolor DarkCyan
Write-Host
(.\Resources\Compile_WEB.ps1)
}
PAUSE
} else{ # Selection
$folderName=$list[$num2-1].Name
$configName="config-"+$list[$num2-1].Type+".toml"
Write-Host Compiling $list[$num2-1].Name WEB -foregroundcolor DarkCyan
Write-Host
(.\Resources\Compile_WEB.ps1)
PAUSE
}
break
}
"3" { # Compile Both PDF and Website
if($num2 -eq $k){ # Complete List
foreach ($file in $list) {
$folderName=$file.Name
$configName="config-"+$file.Type+".toml"
Write-Host Compiling $file.Name WEB -foregroundcolor DarkCyan
Write-Host
(.\Resources\Compile_WEB.ps1)
Write-Host Compiling $file.Name PDF -foregroundcolor DarkCyan
Write-Host
(.\Resources\Compile_PDF.ps1)
}
PAUSE
} else{ # Selection
$folderName=$list[$num2-1].Name
$configName="config-"+$list[$num2-1].Type+".toml"
Write-Host Compiling $list[$num2-1].Name WEB -foregroundcolor DarkCyan
Write-Host
(.\Resources\Compile_WEB.ps1)
Write-Host Compiling $list[$num2-1].Name PDF -foregroundcolor DarkCyan
Write-Host
(.\Resources\Compile_PDF.ps1)
PAUSE
}
break
}
default {return 0; break}
}