Skip to content

Commit 1340b3c

Browse files
committed
Turn stderr of curl into /dev/null
1 parent 6b427fc commit 1340b3c

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

cheat.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Author https://github.com/grigruss
33

44
# Check translate-shell script
5-
if [[ ! $(trans -V) ]]
5+
if ! trans -V >/dev/null
66
then
77
echo -e "\\n\\e[33mWARNING!\\n========\\e[0m"
88
echo -e "To run the script, you need a 'trans' script from this repository:"
@@ -11,7 +11,7 @@ then
1111
fi
1212

1313
# Check curl
14-
if [[ ! $(curl -V) ]]
14+
if ! curl -V >/dev/null
1515
then
1616
echo -e "\\n\\e[33mWARNING!\\n========\\e[0m"
1717
echo -e "To run the script, you need install 'curl'"
@@ -31,7 +31,7 @@ do
3131
shift
3232
done
3333

34-
src=$(curl "cht.sh/${U}?T")
34+
src=$(curl "cht.sh/${U}?T" 2>/dev/null)
3535
IFS=$'\n'
3636
S=''
3737
for answ in $src
@@ -58,11 +58,11 @@ for answ in $src
5858
do
5959
if [[ "${answ:0:1}" == "#" ]]
6060
then
61-
VR="${R["$count"]//#/# \[$lang\]}"
61+
VR="${R[$count]//#/# \[$lang\]}"
6262
VE="${answ//#/# \[en\]}"
6363
if [[ "$T" == 0 ]]
6464
then
65-
echo -e "\e[32;1m$VR\e[0m\n\e[32m$VE\e[0m"
65+
echo -e "\e[32;1m$VR\e[0m\n\e[30;1m$VE\e[0m"
6666
else
6767
echo -e "$VR\n$VE"
6868
fi

0 commit comments

Comments
 (0)