Fixed circular dependency on setup script

pull/22/head
tycrek 3 years ago
parent 5e9dba5bdb
commit 20c939eb3e
No known key found for this signature in database
GPG Key ID: 25D74F3943625263

@ -1,7 +1,10 @@
const fs = require('fs-extra'); const fs = require('fs-extra');
const adjectives = fs.readFileSync('./generators/gfycat/adjectives.txt').toString().split('\n'); const adjectives = fs.readFileSync('./generators/gfycat/adjectives.txt').toString().split('\n');
const animals = fs.readFileSync('./generators/gfycat/animals.txt').toString().split('\n'); const animals = fs.readFileSync('./generators/gfycat/animals.txt').toString().split('\n');
const MIN_LENGTH = require('../setup').gfyIdSize;
// Don't trigger circular dependency during setup
if (!require.main.filename.includes('setup.js'))
var MIN_LENGTH = require('../setup').gfyIdSize;
function getWord(list, delim = '') { function getWord(list, delim = '') {
return list[Math.floor(Math.random() * list.length)].concat(delim); return list[Math.floor(Math.random() * list.length)].concat(delim);

Loading…
Cancel
Save