feat: rss to mastodon worker

modified:   src/includes/base.liquid
This commit is contained in:
Cory Dransfeldt 2024-09-17 14:59:20 -07:00
parent a80d5897e2
commit 9f90a264be
No known key found for this signature in database
8 changed files with 313 additions and 297 deletions

View file

@ -13,16 +13,21 @@ if (!workerName) {
const templatePath = `workers/${workerName}/wrangler.template.toml`
const outputPath = `workers/${workerName}/wrangler.toml`
try {
const template = await fs.readFile(templatePath, 'utf8')
const output = template
.replace(/\${CF_ACCOUNT_ID}/g, process.env.CF_ACCOUNT_ID)
.replace(/\${CF_ZONE_ID}/g, process.env.CF_ZONE_ID)
async function generateToml() {
try {
const template = await fs.readFile(templatePath, 'utf8')
const output = template
.replace(/\${CF_ACCOUNT_ID}/g, process.env.CF_ACCOUNT_ID)
.replace(/\${CF_ZONE_ID}/g, process.env.CF_ZONE_ID)
.replace(/\${RSS_TO_MASTODON_KV_NAMESPACE_ID}/g, process.env.RSS_TO_MASTODON_KV_NAMESPACE_ID)
await fs.writeFile(outputPath, output)
await fs.writeFile(outputPath, output)
console.log(`Generated wrangler.toml for ${workerName}`)
} catch (error) {
console.error('Error generating wrangler.toml:', error)
process.exit(1)
}
console.log(`Generated wrangler.toml for ${workerName}`)
} catch (error) {
console.error('Error generating wrangler.toml:', error)
process.exit(1)
}
}
generateToml()