Skip to content

Commit

Permalink
Defined globals for purpose of passing linting
Browse files Browse the repository at this point in the history
- Is this the best strategy?
  • Loading branch information
aidant19 committed Jan 10, 2024
1 parent 7853449 commit e8d8ef3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
12 changes: 9 additions & 3 deletions scripts/ajexport.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
// With thanks to elenterius on discord for troubleshooting ideas

/*
global Project, fs, loadModelFile, AnimatedJava
*/

const consoleLogJson = (args) => {
console.log(JSON.stringify(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',
);
Expand Down Expand Up @@ -38,6 +40,7 @@ const exportNextFile = () => {
};
exportNextFile();

/*
function getModelPackPaths(modelContent) {
var f = JSON.parse(modelContent);
var resourcePackPath = f.animated_java.settings.resource_pack_mcmeta;
Expand All @@ -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];
Expand All @@ -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'
Expand Down
6 changes: 5 additions & 1 deletion scripts/bb-cli.js
Original file line number Diff line number Diff line change
@@ -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',
Expand All @@ -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];
Expand Down

1 comment on commit e8d8ef3

@aidant19
Copy link
Collaborator Author

@aidant19 aidant19 commented on e8d8ef3 Jan 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes not included in commit message are

  • variable declaration in compliance with linting
  • removed unnecessary lines from ajexport
  • commented out unused functions in compliance with linting

Please sign in to comment.