Skip to content

Commit

Permalink
add support for "_dev" .ajmodel suffix so it is ignored by auto-e…
Browse files Browse the repository at this point in the history
…xport script

- e.g. `housefly_dev.ajmodel`
  • Loading branch information
TheAfroOfDoom committed Jan 15, 2024
1 parent 04c9fd3 commit 2367a90
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions package-scripts/modules/ajexport.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,21 @@
const { existsSync, readdirSync, readFileSync, writeFileSync } = require('fs');
const { resolve } = require('path');

const MODEL_FILE_EXTENSION = '.ajmodel';
const DEV_MODEL_FLAG = '_dev';

export async function script() {
if (typeof AnimatedJava === 'undefined') {
throw new Error('Failed to load Animated Java plugin before CLI plugin');
}
const paths = parseEnv();
const modelDir = paths.ajmodelDir.concat('/');
console.log('Target paths: ', paths);
const files = (await getFiles(modelDir)).filter((file) =>
file.endsWith('.ajmodel'),
);
const files = (await getFiles(modelDir))
.filter((file) => file.endsWith(MODEL_FILE_EXTENSION))
.filter(
(file) => !file.endsWith(`${DEV_MODEL_FLAG}${MODEL_FILE_EXTENSION}`),
); // ignore ajmodels with `_dev` in name e.g. `housefly_dev.ajmodel`

const lastExportedPath = `${paths.ajmodelDir}/last_exported_hashes.json`;
const lastExported = existsSync(lastExportedPath)
Expand Down

0 comments on commit 2367a90

Please sign in to comment.