File tree 1 file changed +7
-5
lines changed
1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
set -euo pipefail
3
3
4
+ RED=' \033[0;31m'
5
+ NC=' \033[0m' # No Color
6
+
4
7
get_releases () {
5
8
curl --silent " https://api.github.com/repos/cdr/code-server/releases/latest" |
6
9
grep ' "browser_download_url":\|"tag_name":'
@@ -32,9 +35,10 @@ linux_install() {
32
35
rm code-server* .tar.gz
33
36
34
37
if [ -d $lib_path ]; then
35
- backup=$( dirname $lib_path ) /BACKUP_$( date +%s) /
36
- mv -f $lib_path / $backup
37
- echo " -- INFO: old code-server directory moved to $backup "
38
+ echo -e " ${RED} -- ERROR: v$version already found in $lib_path ${NC} "
39
+ echo -e " ${RED} -- ERROR: To reinstall, first delete this directory${NC} "
40
+ rm -rf -f $temp_path
41
+ exit 1
38
42
fi
39
43
40
44
mkdir -p $lib_path
@@ -47,8 +51,6 @@ linux_install() {
47
51
rm -rf -f $temp_path
48
52
49
53
if [ $bin_dir != * " $PATH " * ]; then
50
- RED=' \033[0;31m'
51
- NC=' \033[0m' # No Color
52
54
echo -e " ${RED} -- WARNING: $bin_dir is not in your \$ PATH${NC} "
53
55
fi
54
56
You can’t perform that action at this time.
0 commit comments