-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #517 from bernie-g/master
GeckoLib: fix armor template
- Loading branch information
Showing
6 changed files
with
65 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,37 @@ | ||
const fs = require('fs'); | ||
const eol = require('eol'); | ||
const { version, blockbenchConfig } = require('../package.json'); | ||
const PACKAGE_MANIFEST_PATH = '../../plugins.json'; | ||
const manifest = require(`../${PACKAGE_MANIFEST_PATH}`); | ||
(async () => { | ||
const indentString = (await import('indent-string')).default; | ||
const path = require('path'); | ||
const fs = require('fs'); | ||
const eol = require('eol'); | ||
const url = require('url'); | ||
// @ts-ignore | ||
|
||
// console.log({ version, blockbenchConfig }); | ||
const PACKAGE_JSON_PATH = './package.json' | ||
const PLUGINS_MANIFEST_PATH = '../../plugins.json' | ||
|
||
Object.assign( | ||
manifest.animation_utils, | ||
{ version }, | ||
blockbenchConfig, | ||
); | ||
const pluginsString = fs.readFileSync(PLUGINS_MANIFEST_PATH, { encoding: 'utf8' }); | ||
const pluginsObj = JSON.parse(pluginsString); | ||
|
||
fs.writeFileSync(PACKAGE_MANIFEST_PATH, eol.crlf(JSON.stringify(manifest, null, '\t'))); | ||
const packageJsonString = fs.readFileSync(PACKAGE_JSON_PATH, { encoding: 'utf8' }); | ||
const { version, blockbenchConfig } = JSON.parse(packageJsonString); | ||
|
||
// console.log('manifest', manifest); | ||
// console.log({ version, blockbenchConfig }); | ||
|
||
// console.log(`Wrote manifest to ${PACKAGE_MANIFEST_PATH}.`); | ||
const newAnimationUtilsManifest = Object.assign( | ||
{}, | ||
pluginsObj.animation_utils, | ||
{ version }, | ||
blockbenchConfig, | ||
); | ||
const newAnimationUtilsManifestString = | ||
indentString( | ||
JSON.stringify(newAnimationUtilsManifest, null, '\t'), | ||
1, | ||
{ indent: '\t' } | ||
) | ||
.trimStart(); | ||
|
||
const newPluginsString = pluginsString.replace(/("animation_utils":\s*)({[\s\S.]*?})/, `$1${newAnimationUtilsManifestString}`); | ||
|
||
fs.writeFileSync(PLUGINS_MANIFEST_PATH, eol.lf(newPluginsString)); | ||
})(); |