You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/dotnet/scripts/dotnet-helpers.sh
+29-6Lines changed: 29 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -50,7 +50,7 @@ fetch_latest_version() {
50
50
# Example: install_sdk "10.0" "preview"
51
51
install_sdk() {
52
52
local inputVersion="$1"# Could be 'latest', 'lts', 'X.Y', 'X.Y.Z', 'X.Y.4xx', or base channel when paired with quality
53
-
local quality="$2"# Optional quality: preview, daily (empty implies GA)
53
+
local quality="$2"# Optional quality: GA, preview, daily (empty implies GA)
54
54
local version=""
55
55
local channel=""
56
56
if [[ "$inputVersion"=="latest" ]];then
@@ -76,7 +76,10 @@ install_sdk() {
76
76
version="$inputVersion"
77
77
fi
78
78
79
-
local cmd=("$DOTNET_INSTALL_SCRIPT""--version""$version""--channel""$channel""--install-dir""$DOTNET_ROOT")
79
+
local cmd=("$DOTNET_INSTALL_SCRIPT""--version""$version""--install-dir""$DOTNET_ROOT")
80
+
if [ -n"$channel" ];then
81
+
cmd+=("--channel""$channel")
82
+
fi
80
83
if [ -n"$quality" ];then
81
84
cmd+=("--quality""$quality")
82
85
fi
@@ -91,7 +94,7 @@ install_sdk() {
91
94
install_runtime() {
92
95
local runtime="$1"
93
96
local inputVersion="$2"# Could be 'latest', 'lts', 'X.Y', 'X.Y.Z'
94
-
local quality="$3"# Optional quality: preview, daily (empty implies GA)
97
+
local quality="$3"# Optional quality: GA, preview, daily (empty implies GA)
95
98
local version=""
96
99
local channel=""
97
100
if [[ "$inputVersion"=="latest" ]];then
@@ -112,7 +115,10 @@ install_runtime() {
112
115
version="$inputVersion"
113
116
fi
114
117
115
-
local cmd=("$DOTNET_INSTALL_SCRIPT""--runtime""$runtime""--version""$version""--channel""$channel""--install-dir""$DOTNET_ROOT""--no-path")
118
+
local cmd=("$DOTNET_INSTALL_SCRIPT""--runtime""$runtime""--version""$version""--install-dir""$DOTNET_ROOT""--no-path")
119
+
if [ -n"$channel" ];then
120
+
cmd+=("--channel""$channel")
121
+
fi
116
122
if [ -n"$quality" ];then
117
123
cmd+=("--quality""$quality")
118
124
fi
@@ -141,7 +147,10 @@ install_workloads() {
141
147
# A.B-daily
142
148
# A.B.Cxx-preview
143
149
# A.B.Cxx-daily
144
-
# Output (stdout): "<clean_version> <quality>" where quality is one of GA|preview|daily
150
+
# Output (stdout): "<clean_version> <quality>"
151
+
# - For channel specs (A.B or A.B.Cxx) without suffix -> quality is GA
152
+
# - For channel specs with -preview/-daily suffix -> quality is preview/daily
153
+
# - For exact version specs (contain a third numeric segment or prerelease labels beyond channel patterns, e.g. 8.0.100-rc.2.23502.2) -> quality is empty
0 commit comments