Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
114 changes: 114 additions & 0 deletions DESKTOP_LAUNCHER_FIX.md
Original file line number Diff line number Diff line change
@@ -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
```
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.9.0
1.9.1
94 changes: 94 additions & 0 deletions VERSION_MANAGEMENT.md
Original file line number Diff line number Diff line change
@@ -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* 🚀
4 changes: 2 additions & 2 deletions __version__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
64 changes: 60 additions & 4 deletions bash_script_maker.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Version Detection Inconsistency

The get_version() function has two issues: lstrip("v") for Git tags incorrectly removes all 'v' characters from the left, potentially malforming version strings. Additionally, the hardcoded fallback version "1.9.0" is inconsistent with the "1.9.1" used in other version sources, leading to an outdated version being reported if dynamic detection fails.

Fix in Cursor Fix in Web



__version__ = get_version()

import tkinter as tk
from tkinter import scrolledtext, messagebox
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
Expand Down