-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·49 lines (44 loc) · 2.01 KB
/
install.sh
File metadata and controls
executable file
·49 lines (44 loc) · 2.01 KB
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
#!/bin/bash
if [ ! "$BASH_VERSION" ] ; then
echo "Please do not use sh to run this script ($0), just execute it directly" 1>&2
exit 1
fi
echo "Checking dependencies..."
hash git 2>/dev/null || { echo >&2 "I require git but it's not installed. Please install git."; exit 1; }
echo "Git found..."
hash ghc 2>/dev/null || { echo >&2 "I require ghc but it's not installed. Please install ghc."; echo "On ubuntu you can try the command sudo apt-get install haskell-platform"; exit 1; }
echo "GHC found..."
hash python 2>/dev/null || { echo >&2 "I require python but it's not installed. Please install python."; exit 1; }
echo "Python found..."
hash perl 2>/dev/null || { echo >&2 "I require perl but it's not installed. Please install perl."; exit 1; }
echo "Perl found..."
if hash pandoc 2>/dev/null; then
echo "Pandoc found..."
else
if hash cabal 2>/dev/null; then
echo "Installing pandoc..."
cabal update
cabal install pandoc
if hash pandoc 2>/dev/null; then
echo "Pandoc seems to work"
else
echo "Apparently you don't have pandoc in your PATH. Do you wish to include the cabal binary directory ~/.cabal/bin in your path?"
echo "This would add the line 'export PATH=\"\$HOME/.cabal/bin:\$PATH\"' to your .bashrc file.";
echo "Please enter 1 or 2:";
select yn in "Yes" "No"; do
case $yn in
Yes ) echo "export PATH=\"\$HOME/.cabal/bin:\$PATH\"" >> $HOME/.bashrc; export PATH="$HOME/.cabal/bin:$PATH"; break;;
No ) echo "Please run install.sh again when you have put pandoc in your path."; exit;;
esac
done
fi
else
echo >&2 "I require cabal but it's not installed. Please install cabal."; echo "On ubuntu you can try the command sudo apt-get install haskell-platform"; exit 1;
fi
fi
echo "Cloning repository..."
git clone git@github.com:AdvancedKittenry/AdvancedKittenry.github.io.git
cd AdvancedKittenry.github.io
echo "Generating site..."
./make-navigation.sh
make && echo "Site generated. You can press make to regenerate modified files"