aboutsummaryrefslogtreecommitdiff
path: root/scripts/updateRobots.js
blob: 9b16bf1bc0144d7217cbecd91b3579d8654950b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import fs from 'fs'
import dotenv from 'dotenv'

dotenv.config()

let robotsTxt = ''

if (process.env.IS_MIRROR) {
	robotsTxt += `User-agent: *\nDisallow: /\n`
}

await fs.promises.writeFile(
	'static/robots.txt',
	robotsTxt,
	{ encoding: 'utf8' }
)