Redo the submodules file.
This commit is contained in:
		
							parent
							
								
									7aff924a13
								
							
						
					
					
						commit
						3542dc72d2
					
				|  | @ -107,4 +107,4 @@ dist | |||
| public/ | ||||
| 
 | ||||
| submodules/* | ||||
| !submodules/.gitkeep | ||||
| !submodules/update.sh | ||||
|  |  | |||
|  | @ -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. | ||||
|  | @ -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!" | ||||
		Loading…
	
		Reference in New Issue