Fix issue where client slim and extra are appended with -stable on 1.14.4.
This commit is contained in:
12
src/index.ts
12
src/index.ts
@@ -145,11 +145,13 @@ const generateServerCommand: yargs.CommandModule = {
|
|||||||
`\n\t├ Forge version: ${argv.forge}`,
|
`\n\t├ Forge version: ${argv.forge}`,
|
||||||
`\n\t└ LiteLoader version: ${argv.liteloader}`)
|
`\n\t└ LiteLoader version: ${argv.liteloader}`)
|
||||||
|
|
||||||
if (VersionUtil.isPromotionVersion(argv.forge as string)) {
|
if(argv.forge != null) {
|
||||||
console.debug(`Resolving ${argv.forge} Forge Version..`)
|
if (VersionUtil.isPromotionVersion(argv.forge as string)) {
|
||||||
const version = await VersionUtil.getPromotedForgeVersion(argv.version as string, argv.forge as string)
|
console.debug(`Resolving ${argv.forge} Forge Version..`)
|
||||||
console.debug(`Forge version set to ${version}`)
|
const version = await VersionUtil.getPromotedForgeVersion(argv.version as string, argv.forge as string)
|
||||||
argv.forge = version
|
console.debug(`Forge version set to ${version}`)
|
||||||
|
argv.forge = version
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const serverStruct = new ServerStructure(argv.root as string, getBaseURL())
|
const serverStruct = new ServerStructure(argv.root as string, getBaseURL())
|
||||||
|
|||||||
@@ -160,35 +160,38 @@ export class Forge113Adapter extends ForgeResolver {
|
|||||||
group: LibRepoStructure.FORGE_GROUP,
|
group: LibRepoStructure.FORGE_GROUP,
|
||||||
artifact: LibRepoStructure.FORGE_ARTIFACT,
|
artifact: LibRepoStructure.FORGE_ARTIFACT,
|
||||||
version: this.artifactVersion,
|
version: this.artifactVersion,
|
||||||
classifier: undefined
|
classifiers: [undefined]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'universal jar',
|
name: 'universal jar',
|
||||||
group: LibRepoStructure.FORGE_GROUP,
|
group: LibRepoStructure.FORGE_GROUP,
|
||||||
artifact: LibRepoStructure.FORGE_ARTIFACT,
|
artifact: LibRepoStructure.FORGE_ARTIFACT,
|
||||||
version: this.artifactVersion,
|
version: this.artifactVersion,
|
||||||
classifier: 'universal'
|
classifiers: ['universal']
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'client jar',
|
name: 'client jar',
|
||||||
group: LibRepoStructure.FORGE_GROUP,
|
group: LibRepoStructure.FORGE_GROUP,
|
||||||
artifact: LibRepoStructure.FORGE_ARTIFACT,
|
artifact: LibRepoStructure.FORGE_ARTIFACT,
|
||||||
version: this.artifactVersion,
|
version: this.artifactVersion,
|
||||||
classifier: 'client'
|
classifiers: ['client']
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'client slim',
|
name: 'client slim',
|
||||||
group: LibRepoStructure.MINECRAFT_GROUP,
|
group: LibRepoStructure.MINECRAFT_GROUP,
|
||||||
artifact: LibRepoStructure.MINECRAFT_CLIENT_ARTIFACT,
|
artifact: LibRepoStructure.MINECRAFT_CLIENT_ARTIFACT,
|
||||||
version: this.minecraftVersion,
|
version: this.minecraftVersion,
|
||||||
classifier: 'slim'
|
classifiers: [
|
||||||
|
'slim',
|
||||||
|
'slim-stable'
|
||||||
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'client data',
|
name: 'client data',
|
||||||
group: LibRepoStructure.MINECRAFT_GROUP,
|
group: LibRepoStructure.MINECRAFT_GROUP,
|
||||||
artifact: LibRepoStructure.MINECRAFT_CLIENT_ARTIFACT,
|
artifact: LibRepoStructure.MINECRAFT_CLIENT_ARTIFACT,
|
||||||
version: this.minecraftVersion,
|
version: this.minecraftVersion,
|
||||||
classifier: 'data',
|
classifiers: ['data'],
|
||||||
skipIfNotPresent: true
|
skipIfNotPresent: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -196,14 +199,17 @@ export class Forge113Adapter extends ForgeResolver {
|
|||||||
group: LibRepoStructure.MINECRAFT_GROUP,
|
group: LibRepoStructure.MINECRAFT_GROUP,
|
||||||
artifact: LibRepoStructure.MINECRAFT_CLIENT_ARTIFACT,
|
artifact: LibRepoStructure.MINECRAFT_CLIENT_ARTIFACT,
|
||||||
version: this.minecraftVersion,
|
version: this.minecraftVersion,
|
||||||
classifier: 'extra'
|
classifiers: [
|
||||||
|
'extra',
|
||||||
|
'extra-stable'
|
||||||
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'client srg',
|
name: 'client srg',
|
||||||
group: LibRepoStructure.MINECRAFT_GROUP,
|
group: LibRepoStructure.MINECRAFT_GROUP,
|
||||||
artifact: LibRepoStructure.MINECRAFT_CLIENT_ARTIFACT,
|
artifact: LibRepoStructure.MINECRAFT_CLIENT_ARTIFACT,
|
||||||
version: `${this.minecraftVersion}-${mcpVersion}`,
|
version: `${this.minecraftVersion}-${mcpVersion}`,
|
||||||
classifier: 'srg'
|
classifiers: ['srg']
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -211,50 +217,63 @@ export class Forge113Adapter extends ForgeResolver {
|
|||||||
|
|
||||||
for (const entry of generatedFiles) {
|
for (const entry of generatedFiles) {
|
||||||
|
|
||||||
const targetLocalPath = join(
|
const targetLocations: string[] = []
|
||||||
libDir,
|
let located = false
|
||||||
MavenUtil.mavenComponentsToPath(entry.group, entry.artifact, entry.version, entry.classifier)
|
|
||||||
)
|
|
||||||
|
|
||||||
const exists = await pathExists(targetLocalPath)
|
classifierLoop:
|
||||||
if (exists) {
|
for (const _classifier of entry.classifiers) {
|
||||||
|
|
||||||
mdls.push({
|
const targetLocalPath = join(
|
||||||
id: MavenUtil.mavenComponentsToIdentifier(
|
libDir,
|
||||||
entry.group,
|
MavenUtil.mavenComponentsToPath(entry.group, entry.artifact, entry.version, _classifier)
|
||||||
entry.artifact,
|
)
|
||||||
entry.version,
|
|
||||||
entry.classifier
|
targetLocations.push(targetLocalPath)
|
||||||
),
|
|
||||||
name: `Minecraft Forge (${entry.name})`,
|
const exists = await pathExists(targetLocalPath)
|
||||||
type: Type.Library,
|
if (exists) {
|
||||||
artifact: this.generateArtifact(
|
|
||||||
await readFile(targetLocalPath),
|
mdls.push({
|
||||||
await lstat(targetLocalPath),
|
id: MavenUtil.mavenComponentsToIdentifier(
|
||||||
this.repoStructure.getLibRepoStruct().getArtifactUrlByComponents(
|
|
||||||
this.baseUrl,
|
|
||||||
entry.group,
|
entry.group,
|
||||||
entry.artifact,
|
entry.artifact,
|
||||||
entry.version,
|
entry.version,
|
||||||
entry.classifier
|
_classifier
|
||||||
)
|
),
|
||||||
),
|
name: `Minecraft Forge (${entry.name})`,
|
||||||
subModules: []
|
type: Type.Library,
|
||||||
})
|
artifact: this.generateArtifact(
|
||||||
|
await readFile(targetLocalPath),
|
||||||
|
await lstat(targetLocalPath),
|
||||||
|
this.repoStructure.getLibRepoStruct().getArtifactUrlByComponents(
|
||||||
|
this.baseUrl,
|
||||||
|
entry.group,
|
||||||
|
entry.artifact,
|
||||||
|
entry.version,
|
||||||
|
_classifier
|
||||||
|
)
|
||||||
|
),
|
||||||
|
subModules: []
|
||||||
|
})
|
||||||
|
|
||||||
const destination = this.repoStructure.getLibRepoStruct().getArtifactByComponents(
|
const destination = this.repoStructure.getLibRepoStruct().getArtifactByComponents(
|
||||||
entry.group,
|
entry.group,
|
||||||
entry.artifact,
|
entry.artifact,
|
||||||
entry.version,
|
entry.version,
|
||||||
entry.classifier
|
_classifier
|
||||||
)
|
)
|
||||||
|
|
||||||
await move(targetLocalPath, destination, {overwrite: true})
|
await move(targetLocalPath, destination, {overwrite: true})
|
||||||
|
|
||||||
|
located = true
|
||||||
|
break classifierLoop
|
||||||
|
|
||||||
} else {
|
|
||||||
if (!entry.skipIfNotPresent) {
|
|
||||||
throw new Error(`Required file ${entry.name} not found at expected location ${targetLocalPath}!`)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!entry.skipIfNotPresent && !located) {
|
||||||
|
throw new Error(`Required file ${entry.name} not found at any expected location:\n\t${targetLocations.join('\n\t')}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user