Skip to content

Commit 8124720

Browse files
committed
update the xidel installation on MacOS to fix haoel#200 issue
1 parent 53c2af5 commit 8124720

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

scripts/lib/query_problem.sh

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,16 @@ function detect_os()
8181
echo ${platform}
8282
}
8383

84+
function install_brew()
85+
{
86+
TRUE_CMD=`which true`
87+
brew=`type -P brew || ${TRUE_CMD}`
88+
if [ -z "${brew}" ]; then
89+
echo "brew not found !"
90+
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
91+
fi
92+
}
93+
8494
function install_xidel()
8595
{
8696
echo "Install xidel ..."
@@ -120,13 +130,9 @@ function install_xidel()
120130
#install the xidel on MacOS platform
121131
#refer to: https://www.evernote.com/shard/s69/sh/ff1e78f3-a369-4855-b18f-6184ce789c45/f3511927d0fb356ce883835f2eb712e0
122132
if [[ "$platform" == "macos" ]]; then
123-
echo "Downloading xidel......"
124-
xidel_zip=xidel.zip
125-
if [ ! -f ${xidel_zip} ]; then
126-
curl -L https://www.evernote.com/shard/s69/sh/ff1e78f3-a369-4855-b18f-6184ce789c45/f3511927d0fb356ce883835f2eb712e0/res/de33e89a-cdc6-42b5-a476-32e2df1cf4bc/${xidel_zip} -o ${xidel_zip}
127-
fi
128-
unzip ${xidel_zip}
129-
mv xidel /usr/local/bin/
133+
install_brew
134+
echo "brew install xidel..."
135+
brew install xidel
130136
fi
131137

132138
cd ..

0 commit comments

Comments
 (0)