@@ -118,16 +118,19 @@ echo_standalone_postinstall() {
118
118
return
119
119
fi
120
120
121
- channel=mainline
121
+ channel=
122
122
advisory=" To install our stable release (v${STABLE_VERSION} ), use the --stable flag. "
123
- if [ " ${MAINLINE } " = 0 ]; then
124
- channel=stable
123
+ if [ " ${STABLE } " = 1 ]; then
124
+ channel=" stable "
125
125
advisory=" "
126
126
fi
127
+ if [ " ${MAINLINE} " = 1 ]; then
128
+ channel=" mainline "
129
+ fi
127
130
128
131
cath << EOF
129
132
130
- Coder ${channel} release v${VERSION} installed. ${advisory} See our releases documentation or GitHub for more information on versioning.
133
+ Coder ${channel} release v${VERSION} installed. ${advisory} See our releases documentation or GitHub for more information on versioning.
131
134
132
135
The Coder binary has been placed in the following location:
133
136
246
249
247
250
main () {
248
251
MAINLINE=1
252
+ STABLE=0
249
253
TERRAFORM_VERSION=" 1.6.6"
250
254
251
255
if [ " ${TRACE-} " ]; then
@@ -298,17 +302,25 @@ main() {
298
302
;;
299
303
--version)
300
304
VERSION=" $( parse_arg " $@ " ) "
305
+ MAINLINE=0
306
+ STABLE=0
301
307
shift
302
308
;;
303
309
--version=* )
304
310
VERSION=" $( parse_arg " $@ " ) "
311
+ MAINLINE=0
312
+ STABLE=0
305
313
;;
306
314
# Support edge for backward compatibility.
307
315
--mainline | --edge)
316
+ VERSION=
308
317
MAINLINE=1
318
+ STABLE=0
309
319
;;
310
320
--stable)
321
+ VERSION=
311
322
MAINLINE=0
323
+ STABLE=1
312
324
;;
313
325
--rsh)
314
326
RSH=" $( parse_arg " $@ " ) "
@@ -390,12 +402,10 @@ main() {
390
402
STANDALONE_INSTALL_PREFIX=${STANDALONE_INSTALL_PREFIX:-/ usr/ local}
391
403
STANDALONE_BINARY_NAME=${STANDALONE_BINARY_NAME:- coder}
392
404
STABLE_VERSION=$( echo_latest_stable_version)
393
- if [ -z " ${VERSION} " ]; then
394
- if [ " ${MAINLINE} " = 0 ]; then
395
- VERSION=${STABLE_VERSION}
396
- else
397
- VERSION=$( echo_latest_mainline_version)
398
- fi
405
+ if [ " ${MAINLINE} " = 1 ]; then
406
+ VERSION=$( echo_latest_mainline_version)
407
+ elif [ " ${STABLE} " = 1 ]; then
408
+ VERSION=${STABLE_VERSION}
399
409
fi
400
410
401
411
distro_name
@@ -412,9 +422,14 @@ main() {
412
422
413
423
# If the version is the same as the stable version, we're installing
414
424
# the stable version.
415
- if [ " ${MAINLINE} " != 0 ] && [ " ${VERSION} " = " ${STABLE_VERSION} " ]; then
425
+ if [ " ${MAINLINE} " = 1 ] && [ " ${VERSION} " = " ${STABLE_VERSION} " ]; then
416
426
echoh " The latest mainline version has been promoted to stable, selecting stable."
417
427
MAINLINE=0
428
+ STABLE=1
429
+ fi
430
+ # If the manually specified version is stable, mark it as such.
431
+ if [ " ${MAINLINE} " = 0 ] && [ " ${STABLE} " = 0 ] && [ " ${VERSION} " = " ${STABLE_VERSION} " ]; then
432
+ STABLE=1
418
433
fi
419
434
420
435
# Standalone installs by pulling pre-built releases from GitHub.
0 commit comments