64 lines
1.2 KiB
Bash
Raw Normal View History

2018-04-10 00:37:40 +00:00
#!/bin/bash
echo "Checking prerequisites..."
if hash go 2>/dev/null; then
go version
else
echo "Go is not installed"
exit
fi
if hash tsc 2>/dev/null; then
tsc --version
else
echo "TypeScript is not installed"
exit
fi
if hash git 2>/dev/null; then
git version
else
echo "Git is not installed"
exit
fi
if hash git-lfs 2>/dev/null; then
git lfs version
else
echo "Git LFS is not installed"
exit
fi
echo "Looks like the prerequisites were installed correctly!"
2018-04-10 11:10:13 +00:00
2018-04-10 17:46:22 +00:00
# Use sudo here to request permissions for later
2018-04-10 11:10:13 +00:00
sudo echo "---"
2018-04-10 00:37:40 +00:00
# Clone and build main repository
go get -v github.com/animenotifier/notify.moe/...
go get -v github.com/stretchr/testify/assert
2018-04-10 00:37:40 +00:00
cd $GOPATH/src/github.com/animenotifier/notify.moe
make all
# Database
git clone https://github.com/animenotifier/database ~/.aero/db/arn
# Configure
make ports
# Add "127.0.0.1 beta.notify.moe" to /etc/hosts
2018-04-10 10:43:42 +00:00
if grep -Fxq "127.0.0.1 beta.notify.moe" /etc/hosts; then
echo "beta.notify.moe already resolves to localhost"
else
sudo -- sh -c -e "echo '127.0.0.1 beta.notify.moe' >> /etc/hosts"
echo "beta.notify.moe now resolves to localhost"
fi
# Test
2018-04-10 10:43:42 +00:00
make test
# Finished
echo "Finished installation."
echo "You can now execute the 'run' command and open https://beta.notify.moe in your browser."