diff options
Diffstat (limited to 'scripts/updateRobots.js')
-rw-r--r-- | scripts/updateRobots.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/scripts/updateRobots.js b/scripts/updateRobots.js new file mode 100644 index 0000000..9b16bf1 --- /dev/null +++ b/scripts/updateRobots.js @@ -0,0 +1,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' } +)
\ No newline at end of file |