#!/bin/bash

echo "Creating install directory.."
mkdir -p /opt/lit
cp /home/chaz/dev/git/lit/.litignore /opt/lit/.litignore

mkdir -p /opt/lit/examples
cp -r /home/chaz/dev/git/lit/examples/. /opt/lit/examples

echo "Installing libs..."
mkdir -p /opt/lit/lib
cp -r /home/chaz/dev/git/lit/lib/. /opt/lit/lib

echo "Installing api..."
mkdir -p /opt/lit/api
cp -r /home/chaz/dev/git/lit/api/node_modules/. /opt/lit/api/node_modules
cp -r /home/chaz/dev/git/lit/api/dist/. /opt/lit/api/dist

echo "Installing app..."
mkdir -p /opt/lit/app
cp -r /home/chaz/dev/git/lit/app/node_modules/. /opt/lit/app/node_modules
cp -r /home/chaz/dev/git/lit/app/dist/. /opt/lit/app/dist

echo "Starting services..."
sudo systemctl start nginx
sudo systemctl start lit_api.service

echo "Installation complete."
echo "==================================================================="
echo "Instructions: "
echo "Browse to http://localhost:4200"
echo "Enter key: 1234"
