@@ -45,6 +45,11 @@ Usage:
45
45
Sets the prefix used by standalone release archives. Defaults to /usr/local
46
46
and the binary is copied into /usr/local/bin
47
47
To install in \$ HOME, pass ---prefix=\$ HOME/.local
48
+
49
+ --binary-name <name>
50
+ Sets the name for the CLI in standalone release archives. Defaults to "coder"
51
+ To use the CLI as coder2, pass --binary-name=coder2
52
+ Note: in-product documentation will always refer to the CLI as "coder"
48
53
49
54
--rsh <bin>
50
55
Specifies the remote shell for remote installation. Defaults to ssh.
@@ -79,28 +84,25 @@ echo_latest_version() {
79
84
}
80
85
81
86
echo_standalone_postinstall () {
82
- if [ " $STANDALONE_INSTALL_PREFIX " = /usr/local ]; then
83
- cath << EOF
84
-
85
- Standalone release has been installed into /usr/local/bin/coder
87
+ cath << EOF
88
+ Standalone release has been installed into $STANDALONE_INSTALL_PREFIX /bin/$STANDALONE_BINARY_NAME
86
89
87
90
EOF
88
- else
89
- cath << EOF
90
- Standalone release has been installed into $STANDALONE_INSTALL_PREFIX /bin/coder
91
91
92
+ if [ " $STANDALONE_INSTALL_PREFIX " != /usr/local ]; then
93
+ cath << EOF
92
94
Extend your path to use Coder:
93
95
PATH="$STANDALONE_INSTALL_PREFIX /bin:\$ PATH"
94
96
95
97
EOF
96
98
fi
97
99
cath << EOF
98
100
Run Coder (temporary):
99
- coder server --dev
101
+ $STANDALONE_BINARY_NAME server --dev
100
102
101
103
Or run a production deployment with PostgreSQL:
102
104
CODER_PG_CONNECTION_URL="postgres://<username>@<host>/<database>?password=<password>" \\
103
- coder server
105
+ $STANDALONE_BINARY_NAME server
104
106
105
107
EOF
106
108
}
@@ -165,6 +167,13 @@ main() {
165
167
--prefix=* )
166
168
STANDALONE_INSTALL_PREFIX=" $( parse_arg " $@ " ) "
167
169
;;
170
+ --binary-name)
171
+ STANDALONE_BINARY_NAME=" $( parse_arg " $@ " ) "
172
+ shift
173
+ ;;
174
+ --binary-name=* )
175
+ STANDALONE_BINARY_NAME=" $( parse_arg " $@ " ) "
176
+ ;;
168
177
--version)
169
178
VERSION=" $( parse_arg " $@ " ) "
170
179
shift
@@ -225,6 +234,7 @@ main() {
225
234
# releases in order to download and unpack the right release.
226
235
CACHE_DIR=$( echo_cache_dir)
227
236
STANDALONE_INSTALL_PREFIX=${STANDALONE_INSTALL_PREFIX:-/ usr/ local}
237
+ STANDALONE_BINARY_NAME=${STANDALONE_BINARY_NAME:- coder}
228
238
VERSION=${VERSION:- $(echo_latest_version)}
229
239
# These can be overridden for testing but shouldn't normally be used as it can
230
240
# result in a broken coder.
@@ -381,7 +391,7 @@ install_standalone() {
381
391
" $sh_c " unzip -d " $CACHE_DIR " -o " $CACHE_DIR /coder_${VERSION} _${OS} _${ARCH} .zip"
382
392
fi
383
393
384
- " $sh_c " cp " $CACHE_DIR /coder" " $STANDALONE_INSTALL_PREFIX /bin/coder "
394
+ " $sh_c " cp " $CACHE_DIR /coder" " $STANDALONE_INSTALL_PREFIX /bin/$STANDALONE_BINARY_NAME "
385
395
386
396
echo_standalone_postinstall
387
397
}
0 commit comments