From e41f315b9885223fcee7d2b8c7f6631486a60bba Mon Sep 17 00:00:00 2001 From: pyr0ball Date: Mon, 25 May 2026 20:00:15 -0700 Subject: [PATCH] fix: atomic write on existing prefs path; Inkscape 1.x export flags; version check guard --- install.sh | 12 ++++++++---- scripts/merge_prefs.py | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/install.sh b/install.sh index bd18d18..538337a 100755 --- a/install.sh +++ b/install.sh @@ -33,7 +33,8 @@ check_deps() { version=$(inkscape --version 2>/dev/null | grep -oP '\d+\.\d+' | head -1) local major minor IFS='.' read -r major minor <<< "$version" - if (( major < 1 )) || (( major == 1 && minor < 2 )); then + # Skip version check if regex couldn't match (non-standard version string) + if [[ -n "$major" ]] && { (( major < 1 )) || (( major == 1 && minor < 2 )); }; then echo "⚠ Inkscape $version detected. Illuscape targets Inkscape 1.2+." echo " Some settings may not apply correctly. Continue anyway? [y/N]" [[ $AUTO_YES == 1 ]] || { read -r ans; [[ "$ans" =~ ^[Yy]$ ]] || exit 0; } @@ -56,7 +57,7 @@ backup_config() { local backup_dir="${INKSCAPE_CONFIG}.bak-illuscape-$(date +%Y%m%d-%H%M%S)" # If any illuscape backup already exists, skip (idempotent) - if ls "${INKSCAPE_CONFIG}".bak-illuscape-* &>/dev/null 2>&1; then + if ls "${INKSCAPE_CONFIG}".bak-illuscape-* &>/dev/null; then echo "→ Backup already exists — skipping (idempotent)" return 0 fi @@ -139,8 +140,11 @@ install_desktop() { -o "$icon_dir/illuscape.png" 2>/dev/null && continue fi if command -v inkscape &>/dev/null; then - inkscape "$icon_src" --export-png="$icon_dir/illuscape.png" \ - --export-width="$size" --export-height="$size" 2>/dev/null && continue + # Inkscape 1.x uses --export-filename + --export-type (--export-png removed in 1.0) + inkscape --export-filename="$icon_dir/illuscape.png" \ + --export-type=png \ + --export-width="$size" --export-height="$size" \ + "$icon_src" 2>/dev/null && continue fi echo "⚠ Could not rasterize icon at ${size}px (install rsvg-convert for icons)" done diff --git a/scripts/merge_prefs.py b/scripts/merge_prefs.py index 5fe4702..841c1e2 100644 --- a/scripts/merge_prefs.py +++ b/scripts/merge_prefs.py @@ -95,7 +95,7 @@ def merge(prefs_path: Path, patch_path: Path, preset: str) -> None: _merge_nodes(live_root, patch_root) _apply_preset(live_root, preset) - live_tree.write(str(prefs_path), encoding="unicode", xml_declaration=True) + _atomic_write(live_tree, prefs_path) def main() -> None: