forked from Allan1/guide-automator
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathinstall_linux.sh
67 lines (57 loc) · 1.93 KB
/
install_linux.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/sh
set -e
is_executable () {
command -v "$1" >/dev/null 2>&1
}
errcho () {
>&2 echo "$@"
}
echo "# Installing Guide-Automator..."
if ! (is_executable npm && is_executable node); then
echo " # Installing Nodejs"
if is_executable wget; then
wget -qO- https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install -y nodejs
elif is_executable curl; then
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install -y nodejs
else
errcho "Couldn't install NodeJS. Please install NodeJS manually, then run this script again."
errcho "Visit https://nodejs.org/en/download/package-manager/ for instructions on how to install NodeJS on your OS."
exit 1
fi
rm setup_6.x
fi
if ! (is_executable wkhtmltopdf); then
echo " # Installing Dependencie WKHTMLTOPDF"
case $( uname -m ) in
x86_64)
wget http://download.gna.org/wkhtmltopdf/0.12/0.12.3/wkhtmltox-0.12.3_linux-generic-amd64.tar.xz -O wkhtmltox.tar.xz;;
*)
wget http://download.gna.org/wkhtmltopdf/0.12/0.12.3/wkhtmltox-0.12.3_linux-generic-i386.tar.xz -O wkhtmltox.tar.xz;;
esac
tar -xf wkhtmltox.tar.xz
rm wkhtmltox.tar.xz
sudo mv wkhtmltox/ /usr/lib/
cd /usr/bin/
sudo ln -s ../lib/wkhtmltox/bin/wkhtmltopdf wkhtmltopdf
cd ~
fi
if ! (is_executable convert); then
echo " # Installing Dependencie IMAGEMAGICK"
sudo apt-get install imagemagick -y
fi
if ! (is_executable chromedriver) ; then
echo " # Installing Dependencie CHROMEDRIVER"
case $( uname -m ) in
x86_64)
wget https://chromedriver.storage.googleapis.com/2.29/chromedriver_linux64.zip -O chromedriver.zip;;
*)
wget https://chromedriver.storage.googleapis.com/2.29/chromedriver_linux32.zip -O chromedriver.zip;;
esac
unzip chromedriver.zip
sudo mv chromedriver /usr/bin/
rm chromedriver.zip
fi
sudo npm install -g guide-automator
echo "$ guide-automator -h , or check https://www.npmjs.com/package/guide-automator"