Bump to 1.6.2 & Fix handbook generation error

This commit is contained in:
KingRainbow44 2023-07-01 01:28:35 -04:00
parent 762e7ae301
commit 6afa1bf276
No known key found for this signature in database
GPG Key ID: FC2CB64B00D257BE

View File

@ -57,7 +57,7 @@ sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17 targetCompatibility = JavaVersion.VERSION_17
group = 'io.grasscutter' group = 'io.grasscutter'
version = '1.6.1' version = '1.6.2'
java { java {
withJavadocJar() withJavadocJar()
@ -335,10 +335,16 @@ tasks.register('generateHandbook') {
return return
} }
// Resolve the NPM command.
var npm = 'npm'
if (Os.isFamily(Os.FAMILY_WINDOWS))
npm = 'npm.cmd'
def npmVersion = { def npmVersion = {
try { try {
return 'npm --version'.execute().text.trim() return "${npm} --version".execute()
} catch (ignored) { } catch (ignored) {
ignored.printStackTrace()
return 'NPM_NOT_FOUND' return 'NPM_NOT_FOUND'
} }
} }
@ -378,10 +384,6 @@ tasks.register('generateHandbook') {
} }
// Build the handbook. // Build the handbook.
var npm = 'npm'
if (Os.isFamily(Os.FAMILY_WINDOWS))
npm = 'npm.cmd'
exec { exec {
workingDir 'src/handbook' workingDir 'src/handbook'
commandLine npm, 'run', 'build' commandLine npm, 'run', 'build'