Skip to content

Commit e8380ce

Browse files
committed
🚧 v1.4.2
1 parent 0a0617b commit e8380ce

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"type": "module",
33
"name": "animated_java",
44
"title": "Animated Java",
5-
"version": "1.4.1",
6-
"display_version": "1.4.1",
5+
"version": "1.4.2",
6+
"display_version": "1.4.2",
77
"min_blockbench_version": "4.10.0",
88
"author": {
99
"name": "Titus Evans (SnaveSutit)",

tools/plugins/packagerPlugin.ts

+18
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,15 @@ import * as pathjs from 'path'
44
import * as c from 'svelte/compiler'
55
import { mkdirSync, readFileSync, writeFileSync } from 'fs'
66
import * as svelteInternal from 'svelte/internal'
7+
import * as prettier from 'prettier'
78

89
const PACKAGE = JSON.parse(fs.readFileSync('./package.json', 'utf-8'))
910
const PLUGIN_PACKAGE_PATH = './src/pluginPackage/'
1011
const SVELTE_FILE = './src/pluginPackage/about.svelte'
1112
const README_DIST_PATH = './dist/pluginPackage/about.md'
1213
const DIST_PATH = './dist/pluginPackage/'
14+
const PLUGIN_REPO_PATH = 'D:/github-repos/snavesutit/blockbench-plugins/plugins/animated_java'
15+
const PLUGIN_MANIFEST_PATH = 'D:/github-repos/snavesutit/blockbench-plugins/plugins.json'
1316

1417
function plugin(): Plugin {
1518
return {
@@ -40,6 +43,21 @@ function plugin(): Plugin {
4043
writeFileSync(README_DIST_PATH, html)
4144
if (fs.existsSync(pathjs.join(DIST_PATH, 'about.svelte')))
4245
fs.unlinkSync(pathjs.join(DIST_PATH, 'about.svelte'))
46+
47+
if (fs.existsSync(PLUGIN_REPO_PATH)) {
48+
console.log('📋 Copying to plugin repo')
49+
fs.rmSync(PLUGIN_REPO_PATH, { recursive: true, force: true })
50+
fs.cpSync(DIST_PATH, PLUGIN_REPO_PATH, { recursive: true })
51+
const manifest = JSON.parse(fs.readFileSync(PLUGIN_MANIFEST_PATH, 'utf-8'))
52+
manifest.animated_java.version = PACKAGE.version
53+
fs.writeFileSync(
54+
PLUGIN_MANIFEST_PATH,
55+
prettier.format(JSON.stringify(manifest, null, '\t'), {
56+
useTabs: true,
57+
parser: 'json',
58+
})
59+
)
60+
}
4361
})
4462
},
4563
}

0 commit comments

Comments
 (0)