@@ -43,7 +43,7 @@ function Test-Shell {
43
43
}
44
44
}
45
45
46
- function Test-Json {
46
+ function Test-SettingsJson {
47
47
Param (
48
48
[hashtable ] $json ,
49
49
[string ] $settingsDescription ,
@@ -59,7 +59,8 @@ function Test-Json {
59
59
Test-Property - settingsDescription $settingsDescription - json $json - key ' templateUrl' - should
60
60
}
61
61
if ($type -eq ' Project' ) {
62
- # Test for things that should / should not exist in a project settings file
62
+ # GitHubRunner should not be in a project settings file (only read from repo or workflow settings)
63
+ Test-Property - settingsDescription $settingsDescription - json $json - key ' githubRunner' - shouldnot
63
64
}
64
65
if ($type -eq ' Workflow' ) {
65
66
# Test for things that should / should not exist in a workflow settings file
@@ -71,8 +72,9 @@ function Test-Json {
71
72
# templateUrl should not be in Project or Workflow settings
72
73
Test-Property - settingsDescription $settingsDescription - json $json - key ' templateUrl' - maynot
73
74
74
- # schedules and runs-on should not be in Project or Workflow settings
75
- ' nextMajorSchedule' , ' nextMinorSchedule' , ' currentSchedule' , ' githubRunner' , ' runs-on' | ForEach-Object {
75
+ # schedules and runs-on should not be in Project or Workflow settings
76
+ # These properties are used in Update AL-Go System Files, hence they should only be in Repo settings
77
+ ' nextMajorSchedule' , ' nextMinorSchedule' , ' currentSchedule' , ' runs-on' | ForEach-Object {
76
78
Test-Property - settingsDescription $settingsDescription - json $json - key $_ - shouldnot
77
79
}
78
80
}
@@ -92,7 +94,7 @@ function Test-JsonStr {
92
94
93
95
try {
94
96
$json = $jsonStr | ConvertFrom-Json | ConvertTo-HashTable
95
- Test-Json - json $json - settingsDescription $settingsDescription - type:$type
97
+ Test-SettingsJson - json $json - settingsDescription $settingsDescription - type:$type
96
98
}
97
99
catch {
98
100
throw " $ ( $_.Exception.Message.Replace (" `r " , ' ' ).Replace(" `n " , ' ' )) "
@@ -116,9 +118,9 @@ function Test-JsonFile {
116
118
117
119
function Test-ALGoRepository {
118
120
Param (
119
- [string ] $baseFolder
121
+ [string ] $baseFolder = $ ENV: GITHUB_WORKSPACE
120
122
)
121
-
123
+
122
124
if ($ENV: ALGoOrgSettings ) {
123
125
Write-Host " Checking AL-Go Org Settings variable (ALGoOrgSettings)"
124
126
Test-JsonStr - jsonStr " $ENV: ALGoOrgSettings " - settingsDescription ' ALGoOrgSettings variable' - type ' Variable'
@@ -149,141 +151,140 @@ function Test-ALGoRepository {
149
151
}
150
152
151
153
function Write-Big {
152
- Param (
153
- [string ] $str
154
- )
155
- $chars = @ {
156
- " 0" = @'
157
- ___
158
- / _ \
159
- | | | |
160
- | | | |
161
- | |_| |
162
- \___/
163
- '@ .Split(" `n " )
164
- " 1" = @'
165
- __
166
- /_ |
167
- | |
168
- | |
169
- | |
170
- |_|
171
- '@ .Split(" `n " )
172
- " 2" = @'
173
- ___
174
- |__ \
175
- ) |
176
- / /
177
- / /_
178
- |____|
179
- '@ .Split(" `n " )
180
- " 3" = @'
181
- ____
182
- |___ \
183
- __) |
184
- |__ <
185
- ___) |
186
- |____/
187
- '@ .Split(" `n " )
188
- " 4" = @'
189
- _ _
190
- | || |
191
- | || |_
192
- |__ _|
193
- | |
194
- |_|
195
- '@ .Split(" `n " )
196
- " 5" = @'
197
- _____
198
- | ____|
199
- | |__
200
- |___ \
201
- ___) |
202
- |____/
203
- '@ .Split(" `n " )
204
- " 6" = @'
205
- __
206
- / /
207
- / /_
208
- | '_ \
209
- | (_) |
210
- \___/
211
- '@ .Split(" `n " )
212
- " 7" = @'
213
- ______
214
- |____ |
215
- / /
216
- / /
217
- / /
218
- /_/
219
- '@ .Split(" `n " )
220
- " 8" = @'
221
- ___
222
- / _ \
223
- | (_) |
224
- > _ <
225
- | (_) |
226
- \___/
227
- '@ .Split(" `n " )
228
- " 9" = @'
229
- ___
230
- / _ \
231
- | (_) |
232
- \__, |
233
- / /
234
- /_/
235
- '@ .Split(" `n " )
236
- " ." = @'
237
-
238
-
239
-
240
-
241
- _
242
- (_)
243
- '@ .Split(" `n " )
244
- " v" = @'
245
-
246
-
247
- __ __
248
- \ \ / /
249
- \ V /
250
- \_(_)
251
- '@ .Split(" `n " )
252
- " p" = @'
253
- _____ _
254
- | __ \ (_)
255
- | |__) | __ _____ ___ _____ __
256
- | ___/ '__/ _ \ \ / / |/ _ \ \ /\ / /
257
- | | | | | __/\ V /| | __/\ V V /
258
- |_| |_| \___| \_/ |_|\___| \_/\_/
259
- '@ .Split(" `n " )
260
- " d" = @'
261
- _____
262
- | __ \
263
- | | | | _____ __
264
- | | | |/ _ \ \ / /
265
- | |__| | __/\ V /
266
- |_____/ \___| \_(_)
267
- '@ .Split(" `n " )
268
- " a" = @'
269
- _ _____ __ _____ _ _ _ _ _
270
- /\ | | / ____| / _| / ____(_) | | | | | | |
271
- / \ | | ______| | __ ___ | |_ ___ _ __ | | __ _| |_| |__| |_ _| |__
272
- / /\ \ | | |______| | |_ |/ _ \ | _/ _ \| '__| | | |_ | | __| __ | | | | '_ \
273
- / ____ \| |____ | |__| | (_) | | || (_) | | | |__| | | |_| | | | |_| | |_) |
274
- /_/ \_\______| \_____|\___/ |_| \___/|_| \_____|_|\__|_| |_|\__,_|_.__/
275
- '@ .Split(" `n " )
276
- }
277
-
154
+ Param (
155
+ [string ] $str
156
+ )
157
+ $chars = @ {
158
+ " 0" = @ (
159
+ " ___ "
160
+ " / _ \ "
161
+ " | | | |"
162
+ " | | | |"
163
+ " | |_| |"
164
+ " \___/ "
165
+ )
166
+ " 1" = @ (
167
+ " __ "
168
+ " /_ |"
169
+ " | |"
170
+ " | |"
171
+ " | |"
172
+ " |_|"
173
+ )
174
+ " 2" = @ (
175
+ " ___ "
176
+ " |__ \ "
177
+ " ) |"
178
+ " / / "
179
+ " / /_ "
180
+ " |____|"
181
+ )
182
+ " 3" = @ (
183
+ " ____ "
184
+ " |___ \ "
185
+ " __) |"
186
+ " |__ < "
187
+ " ___) |"
188
+ " |____/ "
189
+ )
190
+ " 4" = @ (
191
+ " _ _ "
192
+ " | || | "
193
+ " | || |_ "
194
+ " |__ _|"
195
+ " | | "
196
+ " |_| "
197
+ )
198
+ " 5" = @ (
199
+ " _____ "
200
+ " | ____|"
201
+ " | |__ "
202
+ " |___ \ "
203
+ " ___) |"
204
+ " |____/ "
205
+ )
206
+ " 6" = @ (
207
+ " __ "
208
+ " / / "
209
+ " / /_ "
210
+ " | '_ \ "
211
+ " | (_) |"
212
+ " \___/ "
213
+ )
214
+ " 7" = @ (
215
+ " ______ "
216
+ " |____ |"
217
+ " / / "
218
+ " / / "
219
+ " / / "
220
+ " /_/ "
221
+ )
222
+ " 8" = @ (
223
+ " ___ "
224
+ " / _ \ "
225
+ " | (_) |"
226
+ " > _ < "
227
+ " | (_) |"
228
+ " \___/ "
229
+ )
230
+ " 9" = @ (
231
+ " ___ "
232
+ " / _ \ "
233
+ " | (_) |"
234
+ " \__, |"
235
+ " / / "
236
+ " /_/ "
237
+ )
238
+ " ." = @ (
239
+ " "
240
+ " "
241
+ " "
242
+ " "
243
+ " _ "
244
+ " (_)"
245
+ )
246
+ " v" = @ (
247
+ " "
248
+ " "
249
+ " __ __"
250
+ " \ \ / /"
251
+ " \ V / "
252
+ " \_(_)"
253
+ )
254
+ " p" = @ (
255
+ " _____ _ "
256
+ " | __ \ (_) "
257
+ " | |__) | __ _____ ___ _____ __"
258
+ " | ___/ '__/ _ \ \ / / |/ _ \ \ /\ / /"
259
+ " | | | | | __/\ V /| | __/\ V V / "
260
+ " |_| |_| \___| \_/ |_|\___| \_/\_/ "
261
+ )
262
+ " d" = @ (
263
+ " _____ "
264
+ " | __ \ "
265
+ " | | | | _____ __"
266
+ " | | | |/ _ \ \ / /"
267
+ " | |__| | __/\ V / "
268
+ " |_____/ \___| \_(_)"
269
+ )
270
+ " a" = @ (
271
+ " _ _____ __ _____ _ _ _ _ _ "
272
+ " /\ | | / ____| / _| / ____(_) | | | | | | | "
273
+ " / \ | | ______| | __ ___ | |_ ___ _ __ | | __ _| |_| |__| |_ _| |__ "
274
+ " / /\ \ | | |______| | |_ |/ _ \ | _/ _ \| '__| | | |_ | | __| __ | | | | '_ \ "
275
+ " / ____ \| |____ | |__| | (_) | | || (_) | | | |__| | | |_| | | | |_| | |_) | "
276
+ " /_/ \_\______| \_____|\___/ |_| \___/|_| \_____|_|\__|_| |_|\__,_|_.__/ "
277
+ )
278
+ }
278
279
279
- 0 .. 5 | ForEach-Object {
280
- $line = $_
281
- $str.ToCharArray () | ForEach-Object {
282
- if ($chars.Keys -contains $_ ) {
283
- $ch = $chars ." $_ "
284
- Write-Host - noNewline $ch [$line ]
280
+ $lines = $chars ." a" .Count
281
+ for ($line = 0 ; $line -lt $lines ; $line ++ ) {
282
+ foreach ($ch in $str.ToCharArray ()) {
283
+ if ($chars.Keys -contains $ch ) {
284
+ $bigCh = $chars ." $ch "
285
+ Write-Host - noNewline $bigCh [$line ]
286
+ }
285
287
}
288
+ Write-Host
286
289
}
287
- Write-Host
288
- }
289
290
}
0 commit comments