start-gui.sh et améliorations diverses

This commit is contained in:
2026-09-08 12:04:18 +02:00
parent 06d7bad04e
commit db4ed2ef31
14 changed files with 697 additions and 50 deletions
Executable
+39
View File
@@ -0,0 +1,39 @@
#!/usr/bin/env bash
set -euo pipefail
# With no arguments, choose the newest visible immediate subfolder by mtime.
if [[ $# -eq 0 ]]; then
newest=""
for candidate in "$PWD"/*/; do
[[ -d "$candidate" ]] || continue
folder="${candidate%/}"
folder="${folder##*/}"
case "$folder" in
copienator|copienator_gui|tests|OLD|__pycache__|build|dist|*.egg-info|venv|env|node_modules)
continue
;;
esac
if [[ -z "$newest" || "$candidate" -nt "$newest" ]]; then
newest="$candidate"
fi
done
if [[ -n "$newest" ]]; then
set -- "${newest%/}"
fi
fi
# Resolve the evaluation before changing to the project directory.
if [[ $# -gt 0 && "$1" != -* && "$1" != /* ]]; then
evaluation="$PWD/$1"
shift
set -- "$evaluation" "$@"
fi
repository="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
cd -- "$repository"
if [[ -x "$repository/.venv/bin/python" ]]; then
python_command="$repository/.venv/bin/python"
else
python_command="python3"
fi
exec "$python_command" -m copienator_gui "$@"