@@ -4,12 +4,15 @@ import * as pathjs from 'path'
4
4
import * as c from 'svelte/compiler'
5
5
import { mkdirSync , readFileSync , writeFileSync } from 'fs'
6
6
import * as svelteInternal from 'svelte/internal'
7
+ import * as prettier from 'prettier'
7
8
8
9
const PACKAGE = JSON . parse ( fs . readFileSync ( './package.json' , 'utf-8' ) )
9
10
const PLUGIN_PACKAGE_PATH = './src/pluginPackage/'
10
11
const SVELTE_FILE = './src/pluginPackage/about.svelte'
11
12
const README_DIST_PATH = './dist/pluginPackage/about.md'
12
13
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'
13
16
14
17
function plugin ( ) : Plugin {
15
18
return {
@@ -40,6 +43,21 @@ function plugin(): Plugin {
40
43
writeFileSync ( README_DIST_PATH , html )
41
44
if ( fs . existsSync ( pathjs . join ( DIST_PATH , 'about.svelte' ) ) )
42
45
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
+ }
43
61
} )
44
62
} ,
45
63
}
0 commit comments