Skip to content

Commit ec27350

Browse files
committed
Removes backup step and fails instead
1 parent d172dfc commit ec27350

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

install_helper.sh

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
#!/usr/bin/env bash
22
set -euo pipefail
33

4+
RED='\033[0;31m'
5+
NC='\033[0m' # No Color
6+
47
get_releases() {
58
curl --silent "https://api.github.com/repos/cdr/code-server/releases/latest" |
69
grep '"browser_download_url":\|"tag_name":'
@@ -32,9 +35,10 @@ linux_install() {
3235
rm code-server*.tar.gz
3336

3437
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
3842
fi
3943

4044
mkdir -p $lib_path
@@ -47,8 +51,6 @@ linux_install() {
4751
rm -rf -f $temp_path
4852

4953
if [ $bin_dir != *"$PATH"* ]; then
50-
RED='\033[0;31m'
51-
NC='\033[0m' # No Color
5254
echo -e "${RED}-- WARNING: $bin_dir is not in your \$PATH${NC}"
5355
fi
5456

0 commit comments

Comments
 (0)