Propagate baseURL to resolved forge modules.

This commit is contained in:
Daniel Scalzi
2020-01-12 06:20:23 -05:00
parent 21d80fef82
commit 9e420db907
8 changed files with 107 additions and 46 deletions

View File

@@ -1,6 +1,6 @@
import axios from 'axios'
import { createWriteStream, mkdirs, pathExists } from 'fs-extra'
import { dirname, resolve } from 'path'
import { dirname, join, resolve } from 'path'
import { resolve as resolveURL } from 'url'
import { MavenUtil } from '../../../util/maven'
import { BaseFileStructure } from '../BaseFileStructure'
@@ -26,6 +26,12 @@ export abstract class BaseMavenRepo extends BaseFileStructure {
MavenUtil.mavenComponentsToString(group, artifact, version, classifier, extension))
}
public getArtifactUrlByComponents(baseURL: string, group: string, artifact: string, version: string,
classifier?: string, extension = 'jar'): string {
return resolveURL(baseURL, join(this.relativeRoot,
MavenUtil.mavenComponentsToString(group, artifact, version, classifier, extension)))
}
public async artifactExists(path: string) {
return pathExists(path)
}