From 20c939eb3e25bb4d4d393f1c0557c046154a3719 Mon Sep 17 00:00:00 2001 From: tycrek Date: Mon, 5 Jul 2021 16:47:24 -0600 Subject: [PATCH] Fixed circular dependency on setup script --- generators/gfycat.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/generators/gfycat.js b/generators/gfycat.js index 7df8625..d835fe0 100644 --- a/generators/gfycat.js +++ b/generators/gfycat.js @@ -1,7 +1,10 @@ const fs = require('fs-extra'); const adjectives = fs.readFileSync('./generators/gfycat/adjectives.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 = '') { return list[Math.floor(Math.random() * list.length)].concat(delim);