-
Notifications
You must be signed in to change notification settings - Fork 114
/
port-to-v3.js
executable file
·853 lines (778 loc) · 21.9 KB
/
port-to-v3.js
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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
const
glob = require("glob"),
fs = require("fs-extra"),
SOURCE_DIR = "src",
ASSETS_DIR = "images/global",
path = require('path'),
{ getInfoFromPath } = require('./deploy-helper'),
{ XMLParser } = require("fast-xml-parser"),
yamljs = require("js-yaml"),
BIBLE_PARSER_CONFIG = require("./config.js");
let DIST_DIR = "./dist/port/ss",
DIST_DIR_ASSETS = "./dist/port/assets"
const locales = [
{
"native": "English",
"en": "English",
"code": "en",
"flag": "🇺🇸",
},
{
"native": "Español",
"en": "Spanish",
"code": "es",
"flag": "🇪🇸",
},
{
"native": "Русский",
"en": "Russian",
"code": "ru",
"flag": "🇷🇺",
},
{
"native": "Português",
"en": "Portugese",
"code": "pt",
"flag": "🇧🇷"
},
{
"native": "Українська",
"en": "Ukrainian",
"code": "uk",
"flag": "🇺🇦",
},
{
"native": "Deutsch",
"en": "German",
"code": "de",
"flag": "🇩🇪",
},
{
"native": "Français",
"en": "French",
"code": "fr",
"flag": "🇫🇷",
},
{
"native": "Română",
"en": "Romanian",
"code": "ro",
"flag": "🇷🇴",
},
{
"native": "Türk",
"en": "Turkish",
"code": "tr",
"flag": "🇹🇷",
},
{
"native": "Srpski",
"en": "Serbian",
"code": "sr",
"flag": "🇷🇸",
},
{
"native": "Dansk",
"en": "Danish",
"code": "da",
"flag": "🇩🇰",
},
{
"native": "Български",
"en": "Bulgarian",
"code": "bg",
"flag": "🇧🇬",
},
{
"native": "فارسی",
"en": "Persian",
"code": "fa",
"flag": "🇮🇷",
},
{
"native": "日本語",
"en": "Japanese",
"code": "ja",
"flag": "🇯🇵",
},
{
"native": "Bahasa Indonesia",
"en": "Indonesian",
"code": "in",
"flag": "🇮🇩",
},
{
"native": "한국어",
"en": "Korean",
"code": "ko",
"flag": "🇰🇷",
},
{
"native": "Norsk",
"en": "Norwegian",
"code": "no",
"flag": "🇳🇴",
},
{
"native": "Bahasa Malaysia",
"en": "Malay",
"code": "ms",
"flag": "🇲🇾",
},
{
"native": "中文",
"en": "Chinese",
"code": "zh",
"flag": "🇨🇳",
},
{
"native": "عربى",
"en": "Arabic",
"code": "ar",
"flag": "🇸🇦",
},
{
"native": "Český",
"en": "Czech",
"code": "cs",
"flag": "🇨🇿",
},
{
"native": "עִברִית",
"en": "Hebrew",
"code": "he",
"flag": "🇮🇱",
},
{
"native": "नेपाली",
"en": "Nepali",
"code": "ne",
"flag": "🇳🇵",
},
{
"native": "Македонски",
"en": "Macedonian",
"code": "mk",
"flag": "🇲🇰",
},
{
"native": "Eesti Keel",
"en": "Estonian",
"code": "et",
"flag": "🇪🇪",
},
{
"native": "Viti",
"en": "Fijian",
"code": "fj",
"flag": "🇫🇯",
},
{
"native": "Magyar",
"en": "Hungarian",
"code": "hu",
"flag": "🇭🇺",
},
{
"native": "Italiano",
"en": "Italian",
"code": "it",
"flag": "🇮🇹",
},
{
"native": "ไทย",
"en": "Thai",
"code": "th",
"flag": "🇹🇭",
},
{
"native": "தமிழ்",
"en": "Tamil",
"code": "ta",
"flag": "🇮🇳",
},
{
"native": "Afrikaans",
"en": "Afrikaans",
"code": "af",
"flag": "🇿🇦",
},
{
"native": "Việt",
"en": "Vietnamese",
"code": "vi",
"flag": "🇻🇳",
},
{
"native": "Ελληνικά",
"en": "Greek",
"code": "el",
"flag": "🇬🇷",
},
{
"native": "ລາວ",
"en": "Lao",
"code": "lo",
"flag": "🇱🇦",
},
{
"native": "Polski",
"en": "Polish",
"code": "pl",
"flag": "🇵🇱",
},
{
"native": "Svenska",
"en": "Swedish",
"code": "sv",
"flag": "🇸🇪",
},
{
"native": "Lietuviškai",
"en": "Lithuanian",
"code": "lt",
"flag": "🇱🇹",
},
{
"native": "Sesotho",
"en": "Sesotho",
"code": "st",
"flag": "🇱🇸",
},
{
"native": "Hrvatski",
"en": "Croatian",
"code": "hr",
"flag": "🇭🇷",
},
{
"native": "Tagalog",
"en": "Tagalog",
"code": "tl",
"flag": "🇵🇭",
},
{
"native": "Kiswahili",
"en": "Swahili",
"code": "sw",
"flag": "🇹🇿",
},
{
"native": "Slovenščina",
"en": "Slovenian",
"code": "sl",
"flag": "🇸🇮",
},
{
"native": "Монгол хэл",
"en": "Mongolian",
"code": "mn",
"flag": "🇲🇳",
},
{
"native": "ქართული ენა",
"en": "Georgian",
"code": "ka",
"flag": "🇬🇪",
},
{
"native": "Slovenčina",
"en": "Slovak",
"code": "sk",
"flag": "🇸🇰",
},
{
"native": "Íslenska",
"en": "Icelandic",
"code": "is",
"flag": "🇮🇸",
},
{
"native": "Հայերեն",
"en": "Armenian",
"code": "hy",
"flag": "🇦🇲",
},
{
"native": "IsiZulu",
"en": "Zulu",
"code": "zu",
"flag": "🇿🇦",
},
{
"native": "IsiXhosa",
"en": "Xhosa",
"code": "xh",
"flag": "🇿🇦",
},
{
"native": "हिन्दी",
"en": "Hindi",
"code": "hi",
"flag": "🇮🇳",
},
{
"native": "Shqiptar",
"en": "Albanian",
"code": "sq",
"flag": "🇦🇱",
},
{
"native": "Latviešu valoda",
"en": "Latvian",
"code": "lv",
"flag": "🇱🇻",
},
{
"native": "Nederlandse taal",
"en": "Dutch",
"code": "nl",
"flag": "🇳🇱",
},
{
"native": "አማርኛ",
"en": "Amharic",
"code": "am",
"flag": "🇪🇹",
},
{
"native": "සිංහල",
"en": "Sinhala",
"code": "si",
"flag": "🇱🇰",
},
{
"native": "Ilokano",
"en": "Ilocano",
"code": "ilo",
"flag": "🇵🇭",
},
{
"native": "Hiligaynon",
"en": "Hiligaynon",
"code": "hil",
"flag": "🇵🇭",
},
{
"native": "Suomen kieli",
"en": "Finnish",
"code": "fi",
"flag": "🇫🇮",
},
{
"native": "မြန်မာဘာသာ",
"en": "Burmese",
"code": "my",
"flag": "🇲🇲",
},
{
"native": "ខ្មែរ",
"en": "Khmer",
"code": "km",
"flag": "🇰🇭",
},
{
"native": "Malagasy",
"en": "Malagasy",
"code": "mg",
"flag": "🇲🇬",
},
{
"native": "മലയാളം",
"en": "Malayalam",
"code": "ml",
"flag": "🇮🇳",
},
{
"native": "ಕನ್ನಡ",
"en": "Kannada",
"code": "kn",
"flag": "🇮🇳",
},
{
"native": "Batak Toba",
"en": "Batak Toba",
"code": "bbc",
"flag": "🇮🇩",
},
{
"native": "Kreyòl ayisyen",
"en": "Haitian Creole",
"code": "ht",
"flag": "🇭🇹",
},
{
"native": "Sinugboanon",
"en": "Cebuano",
"code": "ceb",
"flag": "🇵🇭",
},
{
"native": "తెలుగు",
"en": "Telugu",
"code": "te",
"flag": "🇮🇳",
},
{
"native": "Tedim Chin",
"en": "Tedim Chin",
"code": "ctd",
"flag": "🇲🇲",
},
{
"native": "Mizo ṭawng",
"en": "Mizo",
"code": "lus",
"flag": "🇮🇳",
},
{
"native": "मराठी",
"en": "Marathi",
"code": "mr",
"flag": "🇮🇳",
},
{
"native": "ଓଡ଼ିଆ",
"en": "Odia",
"code": "or",
"flag": "🇮🇳",
},
{
"native": "বাংলা",
"en": "Bengali",
"code": "bn",
"flag": "🇧🇩",
},
{
"native": "Khasi",
"en": "Khasi",
"code": "kha",
"flag": "🇮🇳",
},
{
"native": "ગુજરાતી",
"en": "Gujarathi",
"code": "gu",
"flag": "🇮🇳",
},
{
"native": "Garo",
"en": "Garo",
"code": "grt",
"flag": "🇮🇳",
},
{
"native": "ကညီကျိာ်",
"en": "S'gaw Karen",
"code": "kar",
"flag": "🇲🇲",
},
{
"native": "အရှေ့ပိုးကရင်",
"en": "Pwo Karen",
"code": "kjp",
"flag": "🇲🇲",
},
{
"native": "Jaku Iban",
"en": "Iban",
"code": "iba",
"flag": "🇮🇩🇲🇾",
},
{
"native": "Lai ṭong",
"en": "Falam Chin",
"code": "cfm",
"flag": "🇲🇲🇮🇳",
},
{
"native": "Ikinyarwanda",
"en": "Kinyarwanda",
"code": "kin",
"flag": "🇷🇼",
},
{
"native": "ChiShona",
"en": "Shona",
"code": "sn",
"flag": "🇿🇼",
},
{
"native": "Ikirundi",
"en": "Kirundi",
"code": "run",
"flag": "🇧🇮",
},
{
"native": "Català",
"en": "Catalan",
"code": "ca",
"flag": "🇪🇸",
},
{
"native": "Twi",
"en": "Twi",
"code": "tw",
"flag": "🇬🇭",
},
{
"native": "অসমীয়া",
"en": "Assamese",
"code": "as",
"flag": "🇮🇳",
},
{
"native": "Papiamentu",
"en": "Papiamento",
"code": "pap",
"flag": "🇨🇼",
},
{
"native": "Lus Hmoob",
"en": "Hmong",
"code": "hmn",
"flag": "🇻🇳",
},
]
let listDirectoriesSync = (dirPath) => {
try {
const files = fs.readdirSync(dirPath)
let directories = []
for (let file of files) {
const fullPath = path.join(dirPath, file)
const stat = fs.statSync(fullPath)
if (stat.isDirectory()) {
directories.push(fullPath)
}
}
return directories
} catch (err) {
console.error("Error reading directory:", err)
throw err
}
};
let portQuarterliesForLanguage = async function (language) {
console.log(`Porting quarterlies for ${language}`)
let quarterlies = listDirectoriesSync(`./src/${language}`)
for (let quarterly of quarterlies) {
const quarterlyPathInfo = getInfoFromPath(quarterly)
fs.copySync(quarterly, `${DIST_DIR}/${language}/ss/${quarterlyPathInfo.quarterly}`)
if (fs.pathExistsSync(`${DIST_DIR}/${language}/ss/${quarterlyPathInfo.quarterly}/cover.png`)) {
fs.moveSync(`${DIST_DIR}/${language}/ss/${quarterlyPathInfo.quarterly}/cover.png`,
`${DIST_DIR}/${language}/ss/${quarterlyPathInfo.quarterly}/assets/cover.png`)
}
if (fs.pathExistsSync(`${DIST_DIR}/${language}/ss/${quarterlyPathInfo.quarterly}/splash.png`)) {
fs.moveSync(`${DIST_DIR}/${language}/ss/${quarterlyPathInfo.quarterly}/splash.png`,
`${DIST_DIR}/${language}/ss/${quarterlyPathInfo.quarterly}/assets/splash.png`)
}
if (fs.pathExistsSync(`${DIST_DIR}/${language}/ss/${quarterlyPathInfo.quarterly}/pdf.yml`)) {
let pdf = fs.readFileSync(`${DIST_DIR}/${language}/ss/${quarterlyPathInfo.quarterly}/pdf.yml`, 'utf-8')
pdf = pdf.replace(/target:\s*([a-z]{2,3})\//g, 'target: $1/ss/')
fs.outputFileSync(`${DIST_DIR}/${language}/ss/${quarterlyPathInfo.quarterly}/pdf.yml`, pdf)
}
if (fs.pathExistsSync(`${DIST_DIR}/${language}/ss/${quarterlyPathInfo.quarterly}/audio.yml`)) {
let pdf = fs.readFileSync(`${DIST_DIR}/${language}/ss/${quarterlyPathInfo.quarterly}/audio.yml`, 'utf-8')
pdf = pdf.replace(/target:\s*([a-z]{2,3})\//g, 'target: $1/ss/')
fs.outputFileSync(`${DIST_DIR}/${language}/ss/${quarterlyPathInfo.quarterly}/audio.yml`, pdf)
}
if (fs.pathExistsSync(`${DIST_DIR}/${language}/ss/${quarterlyPathInfo.quarterly}/video.yml`)) {
let pdf = fs.readFileSync(`${DIST_DIR}/${language}/ss/${quarterlyPathInfo.quarterly}/video.yml`, 'utf-8')
pdf = pdf.replace(/target:\s*([a-z]{2,3})\//g, 'target: $1/ss/')
fs.outputFileSync(`${DIST_DIR}/${language}/ss/${quarterlyPathInfo.quarterly}/video.yml`, pdf)
}
}
};
let portAllLanguages = async function () {
console.log('Porting languages')
for (let language of glob.sync("src/*/info.yml")) {
const info = getInfoFromPath(language)
const locale = locales.find((l) => l.code === info.language)
let feedSeeAll = "See All"
if (!locale || !BIBLE_PARSER_CONFIG[info.language]) {
console.error(info)
}
// create info.yml
let infoV3 = {
name: locale.en,
native: locale.native,
code: locale.code,
sections: {
default: 'Main',
},
bible: [],
}
const featuresFile = `./src/${info.language}/features.yml`
if (fs.pathExistsSync(featuresFile)) {
infoV3.features = yamljs.load(fs.readFileSync(featuresFile, 'utf-8'))
}
const bibleConfig = BIBLE_PARSER_CONFIG[info.language]
for (let bible of bibleConfig) {
infoV3.bible.push(bible)
}
const xmlTranslationValues = `../sabbath-school-android/common/translations/src/main/res/values-${info.language}/strings.xml`
const groupYamlFile = `./src/${info.language}/groups.yml`
let title = "Sabbath School"
if (fs.pathExistsSync(xmlTranslationValues)) {
const parser = new XMLParser({ignoreAttributes : false})
const valuesData = parser.parse(fs.readFileSync(xmlTranslationValues, 'utf-8'))
const valuesDataTitle = valuesData.resources["string"].find((o) => o["@_name"] === "ss_app_name")
const valuesDataSeeAll = valuesData.resources["string"].find((o) => o["@_name"] === "ss_see_all")
if (valuesDataTitle) {
title = valuesDataTitle["#text"].replace(/(^")|("$)/g, '')
}
if (valuesDataSeeAll) {
feedSeeAll = valuesDataSeeAll["#text"].replace(/(^")|("$)/g, '')
}
}
let DEFAULT_FEED_FILE = {
title,
groups: []
}
if (fs.pathExistsSync(groupYamlFile)) {
const groups = yamljs.load(fs.readFileSync(groupYamlFile, 'utf-8'))
for (let groupKey of Object.keys(groups)) {
if (groupKey === 'default') {
DEFAULT_FEED_FILE.groups.push({
group: groups[groupKey]["name"],
view: "folio",
scope: "resource",
order: groups[groupKey]["order"],
})
} else {
let existingGroup = DEFAULT_FEED_FILE.groups.findIndex(g => g.group === groups[groupKey].name && g.order === groups[groupKey].order)
if (existingGroup >= 0) {
DEFAULT_FEED_FILE.groups[existingGroup].resources[0] += `|*-${groupKey}`
console.log(language)
} else {
DEFAULT_FEED_FILE.groups.push({
group: groups[groupKey]["name"],
view: "folio",
resources: [
`*[0-9-]+-${groupKey}`
],
order: groups[groupKey]["order"],
})
}
}
}
} else {
DEFAULT_FEED_FILE.groups.push({
scope: "resource",
direction: "vertical",
noSeeAll: true,
})
}
DEFAULT_FEED_FILE.groups.map(g => delete g.order)
infoV3.feedSeeAll = feedSeeAll
fs.outputFileSync(`${DIST_DIR}/${info.language}/ss/feed.yml`, yamljs.dump(DEFAULT_FEED_FILE, {lineWidth: -1}))
fs.outputFileSync(`${DIST_DIR}/${info.language}/info.yml`, yamljs.dump(infoV3, {lineWidth: -1}))
await portQuarterliesForLanguage(info.language)
}
}
// ====
let getDestinationFromSource = function (source) {
return source.replace(new RegExp(`^\.?\/?${SOURCE_DIR}/(.*?)/`), `${DIST_DIR}/$1/ss/`)
}
let copyFile = async function (file) {
const dest = getDestinationFromSource(file)
fs.copySync(file, dest)
}
let copySegment = async function (segment) {
await copyFile(segment)
}
let copyResourceInfo = async function (resource) {
const resourceDest = getDestinationFromSource(resource)
fs.copySync(resource, resourceDest)
const coverSource = resource.replace(/info\.yml$/, 'cover.png')
await copyResourceCover(coverSource)
const splashSource = resource.replace(/info\.yml$/, 'splash.png')
await copyResourceSplash(splashSource)
const assetsSource = resource.replace(/info\.yml$/, 'assets/')
await copyResourceAssets(assetsSource)
}
let copyResourceCover = async function (coverSource) {
const coverDest = getDestinationFromSource(coverSource).replace(/cover\.png$/, 'assets/cover.png')
if (fs.pathExistsSync(coverSource)) {
fs.copySync(coverSource, coverDest)
}
}
let copyResourceSplash = async function (splashSource) {
const splashDest = getDestinationFromSource(splashSource).replace(/splash\.png$/, 'assets/splash.png')
if (fs.pathExistsSync(splashSource)) {
fs.copySync(splashSource, splashDest)
}
}
let copyResourceAssets = async function (assetsSource) {
const assetsDest = getDestinationFromSource(assetsSource)
if (fs.pathExistsSync(assetsSource)) {
fs.copySync(assetsSource, assetsDest)
}
}
let copyAuxiliary = async function (auxiliary) {
const auxiliaryDest = getDestinationFromSource(auxiliary)
fs.copySync(auxiliary, auxiliaryDest)
if (fs.pathExistsSync(auxiliaryDest)) {
let convertedAuxiliary = fs.readFileSync(auxiliaryDest, 'utf-8')
convertedAuxiliary = convertedAuxiliary.replace(/target:\s*([a-z]{2,3})\//g, 'target: $1/ss/')
fs.outputFileSync(auxiliaryDest, convertedAuxiliary)
}
}
let copyGlobalAssets = async function (asset) {
const assetDest = asset.replace(new RegExp(`^\.?\/?${ASSETS_DIR}/`), `${DIST_DIR_ASSETS}/images/ss/`)
fs.copySync(asset, assetDest)
}
let copyDocumentInfo = async function (document) {
const documentDest = getDestinationFromSource(document)
fs.copySync(document, documentDest)
const coverSource = document.replace(/info\.yml$/, 'cover.png')
await copyDocumentCover(coverSource)
}
let copyDocumentCover = async function (coverSource) {
const coverDest = getDestinationFromSource(coverSource)
if (fs.pathExistsSync(coverSource)) {
fs.copySync(coverSource, coverDest)
}
}
let processPortOfChangedFiles = async function () {
if (fs.pathExistsSync('./.github/outputs/all_changed_files.json')) {
let changedFiles = require('./.github/outputs/all_changed_files.json')
if (changedFiles && changedFiles.length) {
for (let changedFile of changedFiles) {
if (!/^(src|images)/.test(changedFile)) {
continue
}
if (!fs.pathExistsSync(changedFile)) {
continue
}
if (/^\.?\/?images\/global\//g.test(changedFile)) {
await copyGlobalAssets(changedFile)
}
if (/^\.?\/?src\/[^\/]+\/[^\/]+\/info.yml/g.test(changedFile)) {
await copyResourceInfo(changedFile)
}
if (/^\.?\/?src\/[^\/]+\/[^\/]+\/[^\/]+\/info.yml/g.test(changedFile)) {
await copyDocumentInfo(changedFile)
}
if (/^\.?\/?src\/[^\/]+\/[^\/]+\/cover\.png/g.test(changedFile)) {
await copyResourceCover(changedFile)
}
if (/^\.?\/?src\/[^\/]+\/[^\/]+\/splash\.png/g.test(changedFile)) {
await copyResourceSplash(changedFile)
}
if (/^\.?\/?src\/[^\/]+\/[^\/]+\/(audio|video|pdf).yml/g.test(changedFile)) {
await copyAuxiliary(changedFile)
}
if (/^\.?\/?src\/[^\/]+\/[^\/]+\/assets\//g.test(changedFile)) {
await copyFile(changedFile)
}
if (/^\.?\/?src\/[^\/]+\/[^\/]+\/[^\/]+\/.*?\.(jpg|png|jpeg|mp4|mp3|pdf)$/ig.test(changedFile)) {
await copyFile(changedFile)
}
if (/\.md$/g.test(changedFile)) {
await copySegment(changedFile)
}
}
}
}
}
processPortOfChangedFiles()