dotfiles

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit bfdf0f94a83e0ce02ea3e4401e59d17bee7f9e72
parent f4526c4249a8865fabcfb381c1f5f5213b7f3aad
Author: Linus <93053722+KoenigLinus@users.noreply.github.com>
Date:   Thu, 21 Nov 2024 17:27:45 +0100

exec

Diffstat:
A.scripts/ghsync | 55+++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.scripts/hugoserver | 5+++++
Minit.bash | 7+++++++
3 files changed, 67 insertions(+), 0 deletions(-)

diff --git a/.scripts/ghsync b/.scripts/ghsync @@ -0,0 +1,55 @@ +#!/bin/bash + +# Array mit den Namen der Repositories im Home-Verzeichnis +repos=("school" "writing" "obsidian" "sync" "dotfiles") + +# Funktion zum Synchronisieren eines einzelnen Repositories +sync_repo() { + local repo_path="$1" + local commit_message="$2" + + echo "Synchronizing repository: $repo_path" + + # Wechsle ins Repository-Verzeichnis + cd "$repo_path" || { echo "Failed to access $repo_path"; return 1; } + + # Pull vom Remote-Repository + git pull + + # Alle Änderungen hinzufügen + git add -A + + # Änderungen committen + git commit -m "$commit_message" + + # Änderungen pushen + git push + + # Zurück ins ursprüngliche Verzeichnis + cd - > /dev/null +} + +# Standard-Commit-Nachricht +commit_message="exec" + +# Wenn ein Argument übergeben wurde, verwende es als Commit-Nachricht +if [ "$#" -eq 1 ]; then + commit_message=$1 +fi + +# Wenn das Skript im Home-Verzeichnis (~) ausgeführt wird +if [ "$PWD" == "$HOME" ]; then + # Durchlaufe alle Repositories im Array + for repo in "${repos[@]}"; do + repo_path="$HOME/$repo" + if [ -d "$repo_path/.git" ]; then + sync_repo "$repo_path" "$commit_message" + else + echo "Directory $repo_path is not a git repository." + fi + done +else + # Wenn das Skript nicht im Home-Verzeichnis ausgeführt wird, synchronisiere nur das aktuelle Verzeichnis + sync_repo "$PWD" "$commit_message" +fi + diff --git a/.scripts/hugoserver b/.scripts/hugoserver @@ -0,0 +1,5 @@ +#!/bin/bash + +hugo server --bind 192.168.10.195 --baseURL http://192.168.10.195:1313 --port 1313 + +# 192.168.10.195 diff --git a/init.bash b/init.bash @@ -1,4 +1,11 @@ +rm -rf ~/.config/nvim ln -s ~/dotfiles/nvim ~/.config/nvim + +rm -rf ~/.config/weechat ln -s ~/dotfiles/weechat/ ~/.config/weechat + +rm -rf ~/.sources ln -s ~/dotfiles/.sources/ ~/.sources +rm -rf ~/.scripts +ln -s ~/dotfiles/.scripts/ ~/.scripts