зеркало из https://github.com/Azure/autorest.git
Fix: Extension version fallback to github support for `~` and `^` (#4099)
* Fix github fallback package with range * Wip * Wip * ./
This commit is contained in:
Родитель
415a486cc8
Коммит
3cd141b908
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"changes": [
|
||||
{
|
||||
"packageName": "@autorest/configuration",
|
||||
"comment": "**Bump** @autorest/java default version to 4.0.24",
|
||||
"type": "patch"
|
||||
}
|
||||
],
|
||||
"packageName": "@autorest/configuration",
|
||||
"email": "tiguerin@microsoft.com"
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"changes": [
|
||||
{
|
||||
"packageName": "@azure-tools/extension",
|
||||
"comment": "**Fix** Fallback to github release when version doesn't exists broken if using version range",
|
||||
"type": "patch"
|
||||
}
|
||||
],
|
||||
"packageName": "@azure-tools/extension",
|
||||
"email": "tiguerin@microsoft.com"
|
||||
}
|
|
@ -2,17 +2,17 @@
|
|||
|
||||
The V3 version of the Java Generator.
|
||||
|
||||
``` yaml $(java) && !$(legacy) && !$(v2) && !isRequested('@microsoft.azure/autorest.java')
|
||||
```yaml $(java) && !$(legacy) && !$(v2) && !isRequested('@microsoft.azure/autorest.java')
|
||||
version: ~3.1.0
|
||||
|
||||
use-extension:
|
||||
"@autorest/java": "^4.0.4"
|
||||
"@autorest/java": "^4.0.24"
|
||||
try-require: ./readme.java.md
|
||||
```
|
||||
|
||||
Enable use of the V2 Java generator (and V2 core) with the `--legacy` or `--v2` parameter:
|
||||
|
||||
``` yaml $(java) && ($(legacy) || $(v2) || isRequested('@microsoft.azure/autorest.java'))
|
||||
```yaml $(java) && ($(legacy) || $(v2) || isRequested('@microsoft.azure/autorest.java'))
|
||||
# default the v2 generator to using the last stable @microsoft.azure/autorest-core
|
||||
version: ~2.0.4413
|
||||
|
||||
|
|
|
@ -232,13 +232,13 @@ export class ExtensionManager {
|
|||
// (if it is an autorest.<whatever> project)
|
||||
// https://github.com/Azure/${PROJECT}/releases/download/v${VERSION}/autorest/${PROJECT}-${VERSION}.tgz
|
||||
if (name.startsWith("@autorest/")) {
|
||||
const ghurl = `https://github.com/Azure/${name.replace(
|
||||
"@autorest/",
|
||||
"autorest.",
|
||||
)}/releases/download/v${version}/${name.replace("@", "").replace("autorest/", "autorest-")}-${version.replace(
|
||||
/_/g,
|
||||
"-",
|
||||
)}.tgz`;
|
||||
const githubRepo = name.replace("@autorest/", "autorest.");
|
||||
const githubPkgName = name.replace("@", "").replace("autorest/", "autorest-");
|
||||
const githubVersion = version
|
||||
.replace(/^[~|^]/g, "") // Use the exact version instead of range
|
||||
.replace(/_/g, "-"); // Replace _ with - ;
|
||||
|
||||
const ghurl = `https://github.com/Azure/${githubRepo}/releases/download/v${githubVersion}/${githubPkgName}-${githubVersion}.tgz`;
|
||||
try {
|
||||
const pm = await fetchPackageMetadata(ghurl);
|
||||
if (pm) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче