From e8d8ef3ba8b429f6cd8909695ab4d85771d0eb99 Mon Sep 17 00:00:00 2001 From: aidant19 Date: Wed, 10 Jan 2024 14:36:34 -0500 Subject: [PATCH] Defined globals for purpose of passing linting - Is this the best strategy? --- scripts/ajexport.js | 12 +++++++++--- scripts/bb-cli.js | 6 +++++- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/scripts/ajexport.js b/scripts/ajexport.js index 16b72c46f..7873d9f80 100644 --- a/scripts/ajexport.js +++ b/scripts/ajexport.js @@ -1,5 +1,9 @@ // With thanks to elenterius on discord for troubleshooting ideas +/* +global Project, fs, loadModelFile, AnimatedJava +*/ + const consoleLogJson = (args) => { console.log(JSON.stringify(args)); }; @@ -7,8 +11,6 @@ const consoleLogJson = (args) => { if (typeof AnimatedJava === 'undefined') { throw new Error('Failed to load Animated Java plugin before CLI plugin'); } -let [blockbenchPath, ...ARGV] = electron.getGlobal('process').argv; -const scriptIndicator = ARGV.indexOf('--bb-cli'); const paths = getConfigPaths( 'C:\\Users\\Aidan\\Documents\\Media_Storage\\active_projects\\flowey_remaster\\omega-flowey-minecraft-remastered\\scripts\\config.json', ); @@ -38,6 +40,7 @@ const exportNextFile = () => { }; exportNextFile(); +/* function getModelPackPaths(modelContent) { var f = JSON.parse(modelContent); var resourcePackPath = f.animated_java.settings.resource_pack_mcmeta; @@ -46,7 +49,9 @@ function getModelPackPaths(modelContent) { .datapack_mcmeta; return [resourcePackPath, dataPackPath]; } +*/ +/* function writeModelPackPaths(modelContent, modelFile, paths) { var f = JSON.parse(modelContent); f.animated_java.settings.resource_pack_mcmeta = paths[0]; @@ -55,9 +60,10 @@ function writeModelPackPaths(modelContent, modelFile, paths) { ].datapack_mcmeta = paths[1]; fs.writeFileSync(modelFile, JSON.stringify(f)); } +*/ function injectModelPackPaths(modelContent, paths) { - var f = JSON.parse(modelContent); + let f = JSON.parse(modelContent); f.animated_java.settings.resource_pack_mcmeta = paths[0]; f.animated_java.exporter_settings[ 'animated_java:datapack_exporter' diff --git a/scripts/bb-cli.js b/scripts/bb-cli.js index 9948420b9..e8cc7c9b2 100644 --- a/scripts/bb-cli.js +++ b/scripts/bb-cli.js @@ -1,5 +1,9 @@ // With thanks to fetchbot on discord for the code +/* +global BBPlugin, electron, window +*/ + BBPlugin.register('bb-cli', { title: 'Blockbench CLI', author: 'aiTan', @@ -9,7 +13,7 @@ BBPlugin.register('bb-cli', { variant: 'both', onload() { console.log('BB-CLI loading...'); - let [blockbenchPath, ...ARGV] = electron.getGlobal('process').argv; + let [...ARGV] = electron.getGlobal('process').argv; let scriptIndicator = ARGV.indexOf('--bb-cli'); if (scriptIndicator !== -1) { const scriptPath = ARGV[scriptIndicator + 1];