You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`!!! unable to find existing meta tag in ${name}${filePath}`
134
+
)
135
+
returnfalse
136
+
}
137
+
138
+
awaitfs.writeFile(
139
+
fullPath,
140
+
html.slice(0,match.index)+
141
+
match[0]+
142
+
match[0]
143
+
.replace('name=','property=')
144
+
.replace(
145
+
/property=(?:"([^"]+)"|'([^']+)'|([^>]+)\s)/,
146
+
(_,g1,g2,g3)=>
147
+
g1!==undefined
148
+
? 'property="og:image"'
149
+
: g2!==undefined
150
+
? "property='og:image'"
151
+
: g3!==undefined
152
+
? 'property=og:image'
153
+
: console.error(
154
+
`!!! cannot set og:image in ${fullPath}`
155
+
)??'???'
156
+
)
157
+
.replace(
158
+
/content=(?:"([^"]+)"|'([^']+)'|([^/>]+))/,
159
+
(_,g1,g2,g3)=>
160
+
g1!==undefined
161
+
? `content="${imageUrl}"`
162
+
: g2!==undefined
163
+
? `content='${imageUrl}'`
164
+
: g3!==undefined
165
+
? `content=${imageUrl}`
166
+
: console.error(
167
+
`!!! cannot set image url in ${fullPath}`
168
+
)??'???'
169
+
)+
170
+
html.slice((match.index??0)+match[0].length)
171
+
)
172
+
returntrue
118
173
})
119
174
)
175
+
if(!results.includes(true)){
176
+
console.warn(`! no files changed in ${name}`)
177
+
continue
178
+
}
179
+
awaitexec(
180
+
`git commit -am "feat: Add Open Graph images\n\nAutomated with https://github.com/SheepTester/sheeptester.github.io/blob/master/all/img-previews/index.mts"`,
0 commit comments