#!/usr/bin/env bash

# motherfucking hate npm. Spent 3 hours debugging that when
# NODE_ENV is set to production, npm won't install anything
unset NODE_ENV

echo "Rebuilding deprived main site"
echo "cwd: ${pwd}"

#rm -rf deprived-main-website
#git clone https://gitea.deprived.dev/Sveskejuice/deprived-main-website.git

git restore .
git clean -fd
git pull
git checkout WeGoingBasic

echo "Project files up to date. Proceeding to install deps"

echo "npm config list:"
npm config list

npm cache clean --force
npm i
npm i @sveltejs/adapter-static
npm i @sveltejs/kit
npm i @zerodevx/svelte-img
npm tailwind init

echo "Ready to build, building..."

npm run build

echo "Done rebuilding!"