Skip to content

Commit 233eca0

Browse files
Merge pull request #9 from securebitsorg/feature/github-releases-documentation
Feature/GitHub releases documentation
2 parents d0247d2 + 30c7c1f commit 233eca0

6 files changed

Lines changed: 272 additions & 8 deletions

File tree

DESKTOP_LAUNCHER_FIX.md

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
# 🔧 Desktop Launcher Fix
2+
3+
## Problem
4+
Die Anwendung lässt sich nicht über das Startmenü starten:
5+
```
6+
Fehlermeldung: Programm „/home/marci/.local/bin/bash-script-maker" ist nicht auffindbar
7+
```
8+
9+
## Lösung - Schritt für Schritt
10+
11+
### 1. ✅ App korrekt installieren
12+
```bash
13+
cd /home/marci/Code/Bash-Script-Maker
14+
pip install -e .
15+
```
16+
17+
### 2. ✅ Prüfen ob ausführbare Datei existiert
18+
```bash
19+
ls -la ~/.local/bin/bash-script-maker
20+
# Sollte anzeigen: -rwxr-xr-x. 1 marci marci 219 ... bash-script-maker
21+
```
22+
23+
### 3. ✅ Desktop-Integration installieren
24+
```bash
25+
./install_desktop_integration.sh
26+
```
27+
28+
### 4. ✅ Desktop-Datenbank aktualisieren
29+
```bash
30+
update-desktop-database ~/.local/share/applications
31+
gtk-update-icon-cache ~/.local/share/icons/hicolor/ --ignore-theme-index
32+
```
33+
34+
### 5. 🔄 Desktop-Umgebung neu starten
35+
```bash
36+
# GNOME/KDE/XFCE neu starten oder
37+
# Abmelden und wieder anmelden
38+
```
39+
40+
## Diagnose-Befehle
41+
42+
### Prüfe Installation:
43+
```bash
44+
which bash-script-maker
45+
~/.local/bin/bash-script-maker --version
46+
```
47+
48+
### Prüfe Desktop-Datei:
49+
```bash
50+
cat ~/.local/share/applications/bash-script-maker.desktop
51+
desktop-file-validate ~/.local/share/applications/bash-script-maker.desktop
52+
```
53+
54+
### Prüfe Icons:
55+
```bash
56+
ls ~/.local/share/icons/hicolor/*/apps/bash-script-maker.*
57+
```
58+
59+
### Prüfe PATH:
60+
```bash
61+
echo $PATH | grep -o '/home/marci/.local/bin'
62+
```
63+
64+
## Alternative Lösungen
65+
66+
### Wenn das Problem weiterhin besteht:
67+
68+
#### Option 1: Absolute Pfade in Desktop-Datei
69+
```bash
70+
# Desktop-Datei bearbeiten
71+
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
72+
```
73+
74+
#### Option 2: System-weite Installation
75+
```bash
76+
sudo pip install -e .
77+
# Dann Desktop-Integration mit sudo ausführen
78+
```
79+
80+
#### Option 3: Desktop-Datei manuell erstellen
81+
```bash
82+
cat > ~/.local/share/applications/bash-script-maker.desktop << 'EOF'
83+
[Desktop Entry]
84+
Name=Bash-Script-Maker
85+
Comment=Ein GUI-Programm zur Erstellung von Bash-Scripts
86+
Exec=/home/marci/.local/bin/bash-script-maker
87+
Icon=/home/marci/.local/share/icons/hicolor/48x48/apps/bash-script-maker.png
88+
Terminal=false
89+
Type=Application
90+
Categories=Development;Utility;TextEditor;
91+
Keywords=bash;script;editor;generator;development;
92+
StartupWMClass=bash-script-maker
93+
MimeType=text/x-shellscript;application/x-shellscript;
94+
EOF
95+
96+
chmod +x ~/.local/share/applications/bash-script-maker.desktop
97+
update-desktop-database ~/.local/share/applications
98+
```
99+
100+
## Status nach Fix
101+
102+
- ✅ App installiert: v1.9.0
103+
- ✅ Ausführbare Datei: `/home/marci/.local/bin/bash-script-maker`
104+
- ✅ Desktop-Datei: `~/.local/share/applications/bash-script-maker.desktop`
105+
- ✅ Icons installiert: Verschiedene Größen
106+
- ✅ Desktop-Datenbank aktualisiert
107+
108+
## Test
109+
```bash
110+
# Terminal-Start (sollte funktionieren):
111+
bash-script-maker
112+
113+
# Desktop-Start: Über Anwendungsmenü testen
114+
```

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.9.0
1+
1.9.1

VERSION_MANAGEMENT.md

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# 🔖 Version Management System
2+
3+
## Problem gelöst
4+
Die Anwendung zeigte immer Version "1.2.1" an, obwohl neuere GitHub Releases existierten.
5+
6+
## ✅ Neue dynamische Versionserkennung
7+
8+
### 🎯 Prioritätenreihenfolge:
9+
1. **`__version__.py`** - Dedicated version file
10+
2. **`VERSION`** - Plain text version file
11+
3. **`pyproject.toml`** - Project configuration
12+
4. **Git Tags** - Latest repository tag
13+
5. **Fallback** - Default version (1.9.0)
14+
15+
### 🔧 Implementierung:
16+
```python
17+
def get_version():
18+
"""Ermittelt die aktuelle Version dynamisch"""
19+
# 1. __version__.py Import
20+
# 2. VERSION Datei lesen
21+
# 3. pyproject.toml parsen
22+
# 4. Git-Tag ermitteln (git describe --tags --abbrev=0)
23+
# 5. Fallback zu "1.9.0"
24+
```
25+
26+
## 📁 Versionsdateien synchronisiert
27+
28+
### Aktuelle Version: **1.9.1**
29+
-`VERSION`: 1.9.1
30+
-`__version__.py`: 1.9.1
31+
-`pyproject.toml`: 1.9.1
32+
- ✅ Git Tag: v1.9.1
33+
34+
## 🚀 Automatische Release-Synchronisation
35+
36+
### Bei neuen GitHub Releases:
37+
1. **GitHub Actions** erstellt neuen Tag
38+
2. **Versionsdateien** werden automatisch aktualisiert
39+
3. **App zeigt** korrekte Version an
40+
41+
### Workflow:
42+
```bash
43+
# Neuer Release wird erstellt → v1.9.2
44+
# Automatisch synchronisiert:
45+
echo "1.9.2" > VERSION
46+
sed -i 's/__version__ = ".*"/__version__ = "1.9.2"/' __version__.py
47+
sed -i 's/version = ".*"/version = "1.9.2"/' pyproject.toml
48+
```
49+
50+
## 🧪 Versionsprüfung
51+
52+
### Terminal-Test:
53+
```bash
54+
python3 -c "from bash_script_maker import __version__; print(__version__)"
55+
```
56+
57+
### App-Test:
58+
- Header zeigt: "Version 1.9.1 - Professioneller Bash-Script-Generator"
59+
- About-Dialog zeigt: "Version: 1.9.1"
60+
- Tooltips zeigen: "Bash-Script-Maker v1.9.1"
61+
62+
## 🔄 Zukünftige Verbesserungen
63+
64+
### Option 1: GitHub API Integration
65+
```python
66+
def get_latest_github_version():
67+
import requests
68+
api_url = "https://api.github.com/repos/securebitsorg/Bash-Script-Maker/releases/latest"
69+
# Hole neueste Release-Version
70+
```
71+
72+
### Option 2: Automatische Synchronisation
73+
```yaml
74+
# .github/workflows/sync-version.yml
75+
on:
76+
release:
77+
types: [published]
78+
jobs:
79+
sync-version:
80+
- name: Update version files
81+
- name: Commit changes
82+
```
83+
84+
## ✨ Vorteile der neuen Lösung
85+
86+
- 🎯 **Immer aktuelle Version** in der App
87+
- 🔄 **Automatische Synchronisation** mit GitHub
88+
- 🛡️ **Mehrere Fallback-Optionen** für Robustheit
89+
- 📦 **Konsistente Versionierung** über alle Dateien
90+
- 🧪 **Einfache Testbarkeit** der Versionslogik
91+
92+
---
93+
94+
*Version Management implementiert in v1.9.1* 🚀

__version__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
Version information for Bash-Script-Maker
55
"""
66

7-
__version__ = "1.9.0"
8-
__version_info__ = (1, 9, 0)
7+
__version__ = "1.9.1"
8+
__version_info__ = (1, 9, 1)

bash_script_maker.py

Lines changed: 60 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,66 @@
44
Bash-Script-Maker - Ein GUI-Programm zur Erstellung von Bash-Scripts
55
"""
66

7-
try:
8-
from __version__ import __version__
9-
except ImportError:
10-
__version__ = "1.2.1"
7+
8+
def get_version():
9+
"""Ermittelt die aktuelle Version dynamisch"""
10+
import os
11+
12+
# 1. Versuche __version__.py zu importieren
13+
try:
14+
from __version__ import __version__
15+
16+
return __version__
17+
except ImportError:
18+
pass
19+
20+
# 2. Versuche VERSION Datei zu lesen
21+
try:
22+
script_dir = os.path.dirname(os.path.abspath(__file__))
23+
version_file = os.path.join(script_dir, "VERSION")
24+
if os.path.exists(version_file):
25+
with open(version_file, "r", encoding="utf-8") as f:
26+
return f.read().strip()
27+
except Exception:
28+
pass
29+
30+
# 3. Versuche pyproject.toml zu parsen
31+
try:
32+
script_dir = os.path.dirname(os.path.abspath(__file__))
33+
pyproject_file = os.path.join(script_dir, "pyproject.toml")
34+
if os.path.exists(pyproject_file):
35+
with open(pyproject_file, "r", encoding="utf-8") as f:
36+
content = f.read()
37+
import re
38+
39+
match = re.search(r'version\s*=\s*"([^"]+)"', content)
40+
if match:
41+
return match.group(1)
42+
except Exception:
43+
pass
44+
45+
# 4. Versuche Git-Tag zu ermitteln (falls in Git-Repository)
46+
try:
47+
import subprocess
48+
49+
result = subprocess.run(
50+
["git", "describe", "--tags", "--abbrev=0"],
51+
capture_output=True,
52+
text=True,
53+
cwd=os.path.dirname(os.path.abspath(__file__)),
54+
)
55+
if result.returncode == 0:
56+
tag = result.stdout.strip()
57+
# Entferne 'v' Präfix falls vorhanden
58+
return tag.lstrip("v")
59+
except Exception:
60+
pass
61+
62+
# 5. Fallback
63+
return "1.9.0"
64+
65+
66+
__version__ = get_version()
1167

1268
import tkinter as tk
1369
from tkinter import scrolledtext, messagebox

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "bash-script-maker"
7-
version = "1.9.0"
7+
version = "1.9.1"
88
description = "Ein GUI-Programm zur Erstellung von Bash-Scripts mit visueller Unterstützung"
99
readme = "README.md"
1010
license = {text = "MIT"}

0 commit comments

Comments
 (0)