diff options
author | JP Ungaretti <git@jungaretti.com> | 2023-03-03 03:37:53 +0300 |
---|---|---|
committer | JP Ungaretti <git@jungaretti.com> | 2023-03-03 03:37:53 +0300 |
commit | 2b64508a1ab9f454741b24d504228db8cc0374f1 (patch) | |
tree | 9a6fff68c7e85dd5a8b9661c19b0d3214709742f /src/dotnet | |
parent | b00c0796028f82a4db0b43988cf57e33c5a95691 (diff) |
Add route for LTS option
Diffstat (limited to 'src/dotnet')
-rw-r--r-- | src/dotnet/devcontainer-feature.json | 5 | ||||
-rw-r--r-- | src/dotnet/install.sh | 8 |
2 files changed, 10 insertions, 3 deletions
diff --git a/src/dotnet/devcontainer-feature.json b/src/dotnet/devcontainer-feature.json index 04e5f0c..cbe0054 100644 --- a/src/dotnet/devcontainer-feature.json +++ b/src/dotnet/devcontainer-feature.json @@ -9,17 +9,18 @@ "type": "string", "proposals": [ "latest", + "lts", "7", "6", "3" ], "default": "latest", - "description": "Version of .NET to install. Use 'latest' for the latest LTS version, 'X' for the latest of a major version, or 'X.Y.Z' for a specific version." + "description": "Version of .NET to install. Use 'latest' for the latest version, 'lts' for the latest LTS version, 'X' for the latest of a major version, or 'X.Y.Z' for a specific version." }, "additionalVersions": { "type": "string", "default": "", - "description": "Comma-separated list of additional .NET versions to install. Use 'latest' for the latest LTS version, 'X' for the latest of a major version, or 'X.Y.Z' for a specific version." + "description": "Comma-separated list of additional .NET versions to install. Use 'latest' for the latest version, 'lts' for the latest LTS version, 'X' for the latest of a major version, or 'X.Y.Z' for a specific version." }, "runtimeOnly": { "type": "boolean", diff --git a/src/dotnet/install.sh b/src/dotnet/install.sh index a302947..e21d3f9 100644 --- a/src/dotnet/install.sh +++ b/src/dotnet/install.sh @@ -36,7 +36,7 @@ check_packages() { # The version must be 'latest', use the form 'X', or use the form 'X.Y.Z' install_version() { local version="$1" - local channel="LTS" + local channel="STS" local runtime_arg="" echo "Installing version '$version'..." @@ -47,6 +47,12 @@ install_version() { version="latest" fi + # If version is 'lts', then update the channel + if [ "$version" = "lts" ]; then + channel="LTS" + version="latest" + fi + # Make sure the version is formatted correctly (form 'X' is handled before this) if ! [[ "$version" = "latest" || "$version" =~ ^[0-9]+.[0-9]+.[0-9]+$ ]]; then echo "Invalid version '$version': version must be 'latest' or use the form 'X.Y.Z'" |