-
Notifications
You must be signed in to change notification settings - Fork 0
/
show-error.sh
106 lines (92 loc) · 2.15 KB
/
show-error.sh
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
#!/bin/sh
if [ ! -d 'node_modules' ]
then npm install
fi
rev=$(grep '|| null;' -n node_modules/headers-polyfill/lib/index.mjs);
if [ ! -z "$rev" ]
then # header-polyfill matches pre "cff8faf4f92ba8cfc0e62d000ecde4eb78a0a491"
# commit version. Make sure its post commit version
sed -i 's/)] || null;/)] ?? null;/' node_modules/headers-polyfill/lib/index.mjs ;
fi;
echo;
echo '==================================================';
echo;
echo '--------------------------------';
echo 'show effected method (with problem code)'
echo 'in "node_modules/headers-polyfill/lib/index.mjs"';
echo ' https://github.com/mswjs/headers-polyfill/blob/main/src/Headers.ts#L73';
echo;
head -n 72 node_modules/headers-polyfill/lib/index.mjs | tail -n 3;
echo;
echo '==================================================';
echo;
echo 'Run build process to demonstrate error.';
echo;
echo;
echo;
echo;
echo;
echo;
npm run build;
echo;
echo;
echo;
echo;
echo;
echo;
echo '==================================================';
echo;
echo;
echo;
echo 'Update problem code to pre "cff8faf4f92ba8cfc0e62d000ecde4eb78a0a491" commit state'
echo;
sed -i 's/)] ?? null;/)] || null;/' node_modules/headers-polyfill/lib/index.mjs ;
echo;
echo '--------------------------------';
echo 'show effected method (with updated code to fix problem)'
echo;
head -n 72 node_modules/headers-polyfill/lib/index.mjs | tail -n 3;
echo;
echo '--------------------------------';
echo;
echo;
echo;
echo;
echo;
echo;
echo '==================================================';
echo;
echo 'Rerun build process to demonstrate error no longer occurs';
echo;
echo;
echo;
echo;
echo;
echo;
npm run build;
echo;
echo;
echo;
echo;
echo;
echo;
echo '==================================================';
echo;
echo;
echo;
echo;
echo;
echo;
echo '--------------------------------';
echo 'Put headers-polyfill back to how it was';
echo;
sed -i 's/)] || null;/)] ?? null;/' node_modules/headers-polyfill/lib/index.mjs ;
echo '--------------------------------';
echo;
echo 'show effected method (with problem code restored)'
echo;
head -n 72 node_modules/headers-polyfill/lib/index.mjs | tail -n 3;
echo;
echo '--------------------------------';
echo;
echo;