diff --git a/DESKTOP_LAUNCHER_FIX.md b/DESKTOP_LAUNCHER_FIX.md new file mode 100644 index 0000000..341202a --- /dev/null +++ b/DESKTOP_LAUNCHER_FIX.md @@ -0,0 +1,114 @@ +# 🔧 Desktop Launcher Fix + +## Problem +Die Anwendung lässt sich nicht über das Startmenü starten: +``` +Fehlermeldung: Programm „/home/marci/.local/bin/bash-script-maker" ist nicht auffindbar +``` + +## Lösung - Schritt für Schritt + +### 1. ✅ App korrekt installieren +```bash +cd /home/marci/Code/Bash-Script-Maker +pip install -e . +``` + +### 2. ✅ Prüfen ob ausführbare Datei existiert +```bash +ls -la ~/.local/bin/bash-script-maker +# Sollte anzeigen: -rwxr-xr-x. 1 marci marci 219 ... bash-script-maker +``` + +### 3. ✅ Desktop-Integration installieren +```bash +./install_desktop_integration.sh +``` + +### 4. ✅ Desktop-Datenbank aktualisieren +```bash +update-desktop-database ~/.local/share/applications +gtk-update-icon-cache ~/.local/share/icons/hicolor/ --ignore-theme-index +``` + +### 5. 🔄 Desktop-Umgebung neu starten +```bash +# GNOME/KDE/XFCE neu starten oder +# Abmelden und wieder anmelden +``` + +## Diagnose-Befehle + +### Prüfe Installation: +```bash +which bash-script-maker +~/.local/bin/bash-script-maker --version +``` + +### Prüfe Desktop-Datei: +```bash +cat ~/.local/share/applications/bash-script-maker.desktop +desktop-file-validate ~/.local/share/applications/bash-script-maker.desktop +``` + +### Prüfe Icons: +```bash +ls ~/.local/share/icons/hicolor/*/apps/bash-script-maker.* +``` + +### Prüfe PATH: +```bash +echo $PATH | grep -o '/home/marci/.local/bin' +``` + +## Alternative Lösungen + +### Wenn das Problem weiterhin besteht: + +#### Option 1: Absolute Pfade in Desktop-Datei +```bash +# Desktop-Datei bearbeiten +sed -i 's|Icon=bash-script-maker|Icon=/home/marci/.local/share/icons/hicolor/scalable/apps/bash-script-maker.svg|' ~/.local/share/applications/bash-script-maker.desktop +``` + +#### Option 2: System-weite Installation +```bash +sudo pip install -e . +# Dann Desktop-Integration mit sudo ausführen +``` + +#### Option 3: Desktop-Datei manuell erstellen +```bash +cat > ~/.local/share/applications/bash-script-maker.desktop << 'EOF' +[Desktop Entry] +Name=Bash-Script-Maker +Comment=Ein GUI-Programm zur Erstellung von Bash-Scripts +Exec=/home/marci/.local/bin/bash-script-maker +Icon=/home/marci/.local/share/icons/hicolor/48x48/apps/bash-script-maker.png +Terminal=false +Type=Application +Categories=Development;Utility;TextEditor; +Keywords=bash;script;editor;generator;development; +StartupWMClass=bash-script-maker +MimeType=text/x-shellscript;application/x-shellscript; +EOF + +chmod +x ~/.local/share/applications/bash-script-maker.desktop +update-desktop-database ~/.local/share/applications +``` + +## Status nach Fix + +- ✅ App installiert: v1.9.0 +- ✅ Ausführbare Datei: `/home/marci/.local/bin/bash-script-maker` +- ✅ Desktop-Datei: `~/.local/share/applications/bash-script-maker.desktop` +- ✅ Icons installiert: Verschiedene Größen +- ✅ Desktop-Datenbank aktualisiert + +## Test +```bash +# Terminal-Start (sollte funktionieren): +bash-script-maker + +# Desktop-Start: Über Anwendungsmenü testen +``` diff --git a/VERSION b/VERSION index f8e233b..9ab8337 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.9.0 +1.9.1 diff --git a/VERSION_MANAGEMENT.md b/VERSION_MANAGEMENT.md new file mode 100644 index 0000000..66c5b67 --- /dev/null +++ b/VERSION_MANAGEMENT.md @@ -0,0 +1,94 @@ +# 🔖 Version Management System + +## Problem gelöst +Die Anwendung zeigte immer Version "1.2.1" an, obwohl neuere GitHub Releases existierten. + +## ✅ Neue dynamische Versionserkennung + +### 🎯 Prioritätenreihenfolge: +1. **`__version__.py`** - Dedicated version file +2. **`VERSION`** - Plain text version file +3. **`pyproject.toml`** - Project configuration +4. **Git Tags** - Latest repository tag +5. **Fallback** - Default version (1.9.0) + +### 🔧 Implementierung: +```python +def get_version(): + """Ermittelt die aktuelle Version dynamisch""" + # 1. __version__.py Import + # 2. VERSION Datei lesen + # 3. pyproject.toml parsen + # 4. Git-Tag ermitteln (git describe --tags --abbrev=0) + # 5. Fallback zu "1.9.0" +``` + +## 📁 Versionsdateien synchronisiert + +### Aktuelle Version: **1.9.1** +- ✅ `VERSION`: 1.9.1 +- ✅ `__version__.py`: 1.9.1 +- ✅ `pyproject.toml`: 1.9.1 +- ✅ Git Tag: v1.9.1 + +## 🚀 Automatische Release-Synchronisation + +### Bei neuen GitHub Releases: +1. **GitHub Actions** erstellt neuen Tag +2. **Versionsdateien** werden automatisch aktualisiert +3. **App zeigt** korrekte Version an + +### Workflow: +```bash +# Neuer Release wird erstellt → v1.9.2 +# Automatisch synchronisiert: +echo "1.9.2" > VERSION +sed -i 's/__version__ = ".*"/__version__ = "1.9.2"/' __version__.py +sed -i 's/version = ".*"/version = "1.9.2"/' pyproject.toml +``` + +## 🧪 Versionsprüfung + +### Terminal-Test: +```bash +python3 -c "from bash_script_maker import __version__; print(__version__)" +``` + +### App-Test: +- Header zeigt: "Version 1.9.1 - Professioneller Bash-Script-Generator" +- About-Dialog zeigt: "Version: 1.9.1" +- Tooltips zeigen: "Bash-Script-Maker v1.9.1" + +## 🔄 Zukünftige Verbesserungen + +### Option 1: GitHub API Integration +```python +def get_latest_github_version(): + import requests + api_url = "https://api.github.com/repos/securebitsorg/Bash-Script-Maker/releases/latest" + # Hole neueste Release-Version +``` + +### Option 2: Automatische Synchronisation +```yaml +# .github/workflows/sync-version.yml +on: + release: + types: [published] +jobs: + sync-version: + - name: Update version files + - name: Commit changes +``` + +## ✨ Vorteile der neuen Lösung + +- 🎯 **Immer aktuelle Version** in der App +- 🔄 **Automatische Synchronisation** mit GitHub +- 🛡️ **Mehrere Fallback-Optionen** für Robustheit +- 📦 **Konsistente Versionierung** über alle Dateien +- 🧪 **Einfache Testbarkeit** der Versionslogik + +--- + +*Version Management implementiert in v1.9.1* 🚀 diff --git a/__version__.py b/__version__.py index 91bca03..e04edc6 100644 --- a/__version__.py +++ b/__version__.py @@ -4,5 +4,5 @@ Version information for Bash-Script-Maker """ -__version__ = "1.9.0" -__version_info__ = (1, 9, 0) +__version__ = "1.9.1" +__version_info__ = (1, 9, 1) diff --git a/bash_script_maker.py b/bash_script_maker.py index b1c726f..79ff102 100644 --- a/bash_script_maker.py +++ b/bash_script_maker.py @@ -4,10 +4,66 @@ Bash-Script-Maker - Ein GUI-Programm zur Erstellung von Bash-Scripts """ -try: - from __version__ import __version__ -except ImportError: - __version__ = "1.2.1" + +def get_version(): + """Ermittelt die aktuelle Version dynamisch""" + import os + + # 1. Versuche __version__.py zu importieren + try: + from __version__ import __version__ + + return __version__ + except ImportError: + pass + + # 2. Versuche VERSION Datei zu lesen + try: + script_dir = os.path.dirname(os.path.abspath(__file__)) + version_file = os.path.join(script_dir, "VERSION") + if os.path.exists(version_file): + with open(version_file, "r", encoding="utf-8") as f: + return f.read().strip() + except Exception: + pass + + # 3. Versuche pyproject.toml zu parsen + try: + script_dir = os.path.dirname(os.path.abspath(__file__)) + pyproject_file = os.path.join(script_dir, "pyproject.toml") + if os.path.exists(pyproject_file): + with open(pyproject_file, "r", encoding="utf-8") as f: + content = f.read() + import re + + match = re.search(r'version\s*=\s*"([^"]+)"', content) + if match: + return match.group(1) + except Exception: + pass + + # 4. Versuche Git-Tag zu ermitteln (falls in Git-Repository) + try: + import subprocess + + result = subprocess.run( + ["git", "describe", "--tags", "--abbrev=0"], + capture_output=True, + text=True, + cwd=os.path.dirname(os.path.abspath(__file__)), + ) + if result.returncode == 0: + tag = result.stdout.strip() + # Entferne 'v' Präfix falls vorhanden + return tag.lstrip("v") + except Exception: + pass + + # 5. Fallback + return "1.9.0" + + +__version__ = get_version() import tkinter as tk from tkinter import scrolledtext, messagebox diff --git a/pyproject.toml b/pyproject.toml index 2f3e5b5..8670aa7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "bash-script-maker" -version = "1.9.0" +version = "1.9.1" description = "Ein GUI-Programm zur Erstellung von Bash-Scripts mit visueller Unterstützung" readme = "README.md" license = {text = "MIT"}