File tree Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -41,10 +41,24 @@ curl -L -o libchdb.tar.gz $DOWNLOAD_URL
41
41
# Untar the file
42
42
tar -xzf libchdb.tar.gz
43
43
44
+ # Check if console supports colors, if that define REDECHO and ENDECHO
45
+ if [[ -t 1 ]]; then
46
+ RED=' \033[0;31m'
47
+ NC=' \033[0m'
48
+ REDECHO () { echo -e " ${RED} $@ ${NC} " ; }
49
+ ENDECHO () { echo -ne " ${NC} " ; }
50
+ else
51
+ REDECHO () { echo " $@ " ; }
52
+ ENDECHO () { : ; }
53
+ fi
54
+
44
55
# If current uid is 0, SUDO is not required
45
56
SUDO=' '
46
57
if [[ $EUID -ne 0 ]]; then
47
58
SUDO=' sudo'
59
+ REDECHO " \nYou may be asked for your sudo password to install:" ; ENDECHO
60
+ echo " libchdb.so to /usr/local/lib/"
61
+ echo " chdb.h to /usr/local/include/"
48
62
fi
49
63
50
64
# Install the library and header file
62
76
# Clean up
63
77
rm -f libchdb.tar.gz libchdb.so chdb.h
64
78
65
- echo " Installation completed successfully."
66
- echo " If any error occurred, please report it to:"
67
- echo " https://github.com/chdb-io/chdb/issues/new/choose"
79
+ REDECHO " Installation completed successfully." ; ENDECHO
80
+ REDECHO " If any error occurred, please report it to:" ; ENDECHO
81
+ REDECHO " https://github.com/chdb-io/chdb/issues/new/choose" ; ENDECHO
You can’t perform that action at this time.
0 commit comments