-
Notifications
You must be signed in to change notification settings - Fork 1
/
package-scripts.js
67 lines (63 loc) · 2.34 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
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.check',
check: series('nps lint.prettier.check', 'nps lint.eslint.check'),
fix: series('nps lint.prettier.fix', 'nps lint.eslint.fix'),
eslint: {
default: 'nps lint.eslint.check',
check: 'eslint .',
fix: 'eslint --fix .',
},
prettier: {
default: 'nps lint.prettier.check',
check: 'prettier --check .',
fix: 'prettier --write .',
},
},
},
};