@@ -9,15 +9,15 @@ usage() {
9
9
if [ " $0 " = sh ]; then
10
10
arg0=" curl -fsSL https://code-server.dev/install.sh | sh -s --"
11
11
else
12
- curl_usage =" The latest script is available at https://code-server.dev/install.sh
12
+ not_curl_usage =" The latest script is available at https://code-server.dev/install.sh
13
13
"
14
14
fi
15
15
16
16
cath << EOF
17
17
Installs code-server for Linux and macOS.
18
18
It tries to use the system package manager if possible.
19
19
After successful installation it explains how to start using code-server.
20
- ${curl_usage -}
20
+ ${not_curl_usage -}
21
21
Usage:
22
22
23
23
$arg0 [--dry-run] [--version X.X.X] [--method detect] [--prefix ~/.local]
@@ -286,19 +286,14 @@ install_aur() {
286
286
echoh " Installing from the AUR."
287
287
echoh
288
288
289
- tmp_dir=" $( mktemp -d) "
290
-
291
- echoh " + Downloading PKGBUILD into $tmp_dir from https://aur.archlinux.org/cgit/aur.git/snapshot/code-server.tar.gz"
292
- curl -fsSL https://aur.archlinux.org/cgit/aur.git/snapshot/code-server.tar.gz | tar -xzC " $tmp_dir "
293
- VERSION=" $( . " $tmp_dir /code-server/PKGBUILD" && echo " $pkgver " ) "
294
-
295
- sh_c mkdir -p " $CACHE_DIR /code-server-$VERSION -aur"
296
- sh_c cp -a " $tmp_dir /code-server/*" " $CACHE_DIR /code-server-$VERSION -aur"
297
- sh_c cd " $CACHE_DIR /code-server-$VERSION -aur"
289
+ sh_c mkdir -p " $CACHE_DIR /code-server-aur"
290
+ sh_c " curl -#fsSL https://aur.archlinux.org/cgit/aur.git/snapshot/code-server.tar.gz | tar -xzC $CACHE_DIR /code-server-aur --strip-components 1"
291
+ echo " + cd $CACHE_DIR /code-server-aur"
292
+ if [ ! " ${DRY_RUN-} " ]; then
293
+ cd " $CACHE_DIR /code-server-aur"
294
+ fi
298
295
sh_c makepkg -si
299
296
300
- rm -R " $tmp_dir "
301
-
302
297
echo_systemd_postinstall
303
298
}
304
299
@@ -478,9 +473,10 @@ echoerr() {
478
473
echoh " $@ " >&2
479
474
}
480
475
481
- # humanpath replaces all occurances of $HOME with ~
476
+ # humanpath replaces all occurances of " $HOME" with " ~"
477
+ # and all occurances of '"$HOME' with the literal '"$HOME'.
482
478
humanpath () {
483
- sed " s#$HOME #~ #g"
479
+ sed " s# $HOME # ~#g; s# \" $HOME # \"\$ HOME #g"
484
480
}
485
481
486
482
main " $@ "
0 commit comments