From bb9a7d7d369a20d0d034d0056816d1ce7df829ac Mon Sep 17 00:00:00 2001 From: SFKao Date: Tue, 10 Mar 2026 11:03:06 +0100 Subject: [PATCH] =?UTF-8?q?A=C3=B1adir=20updateMods.sh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- updateMods.sh | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 updateMods.sh diff --git a/updateMods.sh b/updateMods.sh new file mode 100644 index 0000000..bdb7f53 --- /dev/null +++ b/updateMods.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +cd "$(dirname "$0")" || exit 1 +echo "Iniciando" +# Check if git is installed +if ! command -v git >/dev/null 2>&1; then + echo "Git no está instalado" + echo "Instálalo desde https://git-scm.com/downloads" + exit 1 +fi + +# If not already a git repo, initialize and fetch +if [ ! -d ".git" ]; then + echo "Git no esta inicializado" + git init + git remote add origin https://git.sfkao.net/SFKao/All-Of-Create.git + git fetch + git checkout -t origin/main -f +fi +echo "Bajando..." +# Fetch and pull updates +if ! git fetch --progress || ! git pull --rebase --autostash --progress; then + echo "Han habido errores actualizando, contactar con SFKao" + exit 1 +fi + +# Equivalent to pause (wait for user input before closing) +read -rp "Presiona Enter para salir..."