-
Notifications
You must be signed in to change notification settings - Fork 1
/
package-scripts.js
78 lines (74 loc) · 2.68 KB
/
package-scripts.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
const { concurrent, series } = require('nps-utils');
const {
datapacksGlob,
resourcepackGlob,
} = require('./package-scripts/shared-consts');
const minecraftPath = 'C:/Users/afro/AppData/Roaming/.minecraft';
const worldName = 'omega-flowey-remastered';
const resourcePackName = 'omega-flowey-remastered-resourcepack';
const minecraftWorldPath = `${minecraftPath}/saves/${worldName}`;
const minecraftResourcePackPath = `${minecraftPath}/resourcepacks/${resourcePackName}`;
const watchExcludeFilter = './package-scripts/watch-filter';
module.exports = {
scripts: {
default: concurrent.nps('watch.datapacks', 'watch.resourcepack'),
watch: {
datapacks: `watch --wait=1 --filter=${watchExcludeFilter} "nps sync.datapacks" datapacks`,
resourcepack: `watch --wait=1 --filter=${watchExcludeFilter} "nps sync.resourcepack" resourcepack`,
},
sync: {
datapacks: series(
'echo syncing datapacks',
'nps delete.datapacks',
'nps copy.datapacks',
'echo finished datapacks',
'mpg123 -f -5000 -q ./temp/anyway.mp3 || echo mpg123 not found on your system -- cannot play notification sound',
),
resourcepack: series(
'echo syncing resourcepack',
'nps delete.resourcepack',
'nps copy.resourcepack',
'echo finished resourcepack',
'mpg123 -f -5000 -q ./temp/fnaf.mp3 || echo mpg123 not found on your system -- cannot play notification sound',
),
world: series(
'rimraf world.zip',
`bestzip world.zip ${minecraftWorldPath}/*`,
),
},
copy: {
datapacks: `cpy ${datapacksGlob} ${minecraftWorldPath}/datapacks`,
resourcepack: `cpy ${resourcepackGlob} ${minecraftResourcePackPath}`,
},
delete: {
datapacks: `yarn rimraf --glob ${minecraftWorldPath}/datapacks/**/*`,
resourcepacks: `yarn rimraf --glob ${minecraftResourcePackPath}/**/*`,
},
lint: {
default: 'nps lint.resourcepack lint.scripts',
fix: 'nps lint.scripts.fix',
scripts: {
default: 'nps lint.scripts.check',
check: series(
'nps lint.scripts.prettier.check',
'nps lint.scripts.eslint.check',
),
fix: series(
'nps lint.scripts.prettier.fix',
'nps lint.scripts.eslint.fix',
),
eslint: {
default: 'nps lint.scripts.eslint.check',
check: 'eslint .',
fix: 'eslint --fix .',
},
prettier: {
default: 'nps lint.scripts.prettier.check',
check: 'prettier --check .',
fix: 'prettier --write .',
},
},
resourcepack: `node ./package-scripts/run-linting-rules --glob "${resourcepackGlob}"`,
},
},
};