From 83f0821b360b4afdb6395fb9da0360f1cbb8f501 Mon Sep 17 00:00:00 2001 From: JeremyStarTM Date: Sun, 19 May 2024 20:49:30 +0200 Subject: [PATCH] Add godot-setup method/command --- lone-files/bashrc | 61 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/lone-files/bashrc b/lone-files/bashrc index 80c47076..f41e59e5 100644 --- a/lone-files/bashrc +++ b/lone-files/bashrc @@ -34,6 +34,67 @@ function osu-oszimport() { done fi } +function godot-setup() { + ( + set -eo pipefail + if [ ! -f "project.godot" ]; then + echo ":: Error: No project.godot file was found." + exit + fi + + if [ -n "$HELP" ]; then + echo ":: Available environment variables:" + echo " \$CORE_BRANCH=" + echo " \$INSTALL_SUI=" + echo " \$INSTALL_VENUS=" + echo "" + echo ":: Note: The first listed value is the default" + echo " for that specific environment variable." + exit + fi + if [ -z "$CORE_BRANCH" ]; then CORE_BRANCH=develop; fi + if [ -z "$INSTALL_SUI" ]; then INSTALL_SUI=false; fi + if [ -z "$INSTALL_VENUS" ]; then INSTALL_VENUS=false; fi + + if [ ! -d ".git" ]; then + echo ":: Initializing git repository" + git init -b develop + fi + + echo ":: Creating files" + wget -q --show-progress "https://www.gnu.org/licenses/agpl-3.0.txt" -O LICENSE + cat << EOF >> README.md +# New project +You need to fill this README.md out. +EOF + + echo ":: Removing default icon" + rm -rf icon.png + + echo ":: Creating directories" + mkdir -p src scenesrc assets/{images,sprites,music,sfx,fonts,themes} dist/submodules addons + + echo ":: Installing CORE" + git submodule add https://git.staropensource.de/StarOpenSource/CORE-distrib-git.git dist/submodules/CORE + ( + cd dist/submodules/CORE + git checkout "$CORE_BRANCH" + ) + ln -s dist/submodules/CORE CORE + + if [ "$INSTALL_SUI" == "true" ]; then + echo ":: Installing StarOpenSource UI" + git submodule add https://git.staropensource.de/StarOpenSource/SUI-distrib.git dist/submodules/SUI + ln -s ../dist/submodules/SUI addons/SUI + fi + + if [ "$INSTALL_VENUS" == "true" ]; then + echo ":: Installing Venus" + git submodule add https://git.staropensource.de/StarOpenSource/venus.git dist/submodules/Venus + ln -s ../dist/submodules/Venus addons/venus + fi + ) +} export "RUSTFLAGS=-Z threads=$(nproc)" export "EDITOR=nano" function cleanhome() {