File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
- set -e
2
+ set -euo pipefail
3
3
4
4
get_releases () {
5
5
curl --silent " https://api.github.com/repos/cdr/code-server/releases/latest" |
6
6
grep ' "browser_download_url":\|"tag_name":'
7
7
}
8
8
9
9
linux_install () {
10
- bin_path=$HOME /bin
11
- lib_path=$HOME /lib
10
+ bin_path=$HOME /.local/ bin
11
+ lib_path=$HOME /.local/ lib
12
12
13
13
releases=$( get_releases)
14
14
package=$( echo " $releases " | grep ' linux' | grep ' x86' | sed -E ' s/.*"([^"]+)".*/\1/' )
@@ -49,8 +49,11 @@ linux_install() {
49
49
50
50
rm -rf -f $temp_path
51
51
52
+ if [ $bin_path != * " $PATH " * ]; then
53
+ echo " -- WARNING: ~/.local/bin is not in your \$ PATH"
54
+ fi
55
+
52
56
echo " -- Successfully installed code-server at $bin_path /code-server"
53
- echo " -- Ensure that $bin_path is present in your \$ PATH"
54
57
}
55
58
56
59
mac_install () {
@@ -92,7 +95,6 @@ mac_install() {
92
95
rm -rf -f $temp_path
93
96
94
97
echo " -- Successfully installed code-server at $bin_path /code-server"
95
-
96
98
}
97
99
98
100
if [[ $OSTYPE == " linux-gnu" ]]; then
@@ -101,4 +103,5 @@ elif [[ $OSTYPE == "darwin"* ]]; then
101
103
mac_install
102
104
else
103
105
echo " Unknown operating system. Not installing."
106
+ exit 1
104
107
fi
You can’t perform that action at this time.
0 commit comments