1
Fork 0

Redo the submodules file.

This commit is contained in:
Bauke 2020-08-02 22:18:02 +02:00
parent 7aff924a13
commit 3542dc72d2
Signed by: Bauke
GPG Key ID: C1C0F29952BCF558
3 changed files with 39 additions and 13 deletions

2
.gitignore vendored
View File

@ -107,4 +107,4 @@ dist
public/
submodules/*
!submodules/.gitkeep
!submodules/update.sh

View File

@ -1,12 +0,0 @@
# This `submodules` directory exists to hold external projects, but without using
# Git's submodule functionality (because they're kind of a pain in the ass to use).
# To initialize the submodules needed to build the website, run the following
# commands in this directory.
git clone git@git.holllo.cc/Bauke/userstyles.git
cd userstyles
yarn --silent
# Then, if they ever need to be updated, just pull the changes and run Yarn
# again, if necessary.

38
submodules/update.sh Executable file
View File

@ -0,0 +1,38 @@
#!/usr/bin/env bash
set -e
# This `submodules` directory exists to hold external projects, but without using
# Git's submodule functionality (because they're kind of a pain in the ass to use).
# To initialize the submodules needed to build the website, just execute
# this file from the directory it's in with `./update.sh`.
# Then, if they ever need to be updated, just execute this file again.
update() {
repo=$1
directory=$2
echo "[$directory] $repo"
if [ -d "$directory" ]; then
echo "[$directory] Pulling Git commits."
cd $directory
git pull
else
echo "[$directory] Cloning Git repository."
git clone $repo $directory
cd $directory
fi
echo "[$directory] Installing Yarn dependencies."
yarn --silent
cd ..
echo
}
update "git@git.holllo.cc:Bauke/userscripts.git" "userscripts"
update "git@git.holllo.cc:Bauke/userstyles.git" "userstyles"
echo "All done!"