diff --git a/check.sh b/check.sh new file mode 100644 index 0000000..1daa55c --- /dev/null +++ b/check.sh @@ -0,0 +1,2 @@ +source .venv/Scripts/activate +wgo -debounce 1000ms -file .py clear :: ruff check \ No newline at end of file diff --git a/deploy.sh b/deploy.sh new file mode 100644 index 0000000..1d25714 --- /dev/null +++ b/deploy.sh @@ -0,0 +1,51 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Always run from this script's directory +cd "$(dirname "$0")" + +# Build a fresh wheel and install it as a uv tool to avoid stale caches +uv tool uninstall susser >/dev/null 2>&1 || true +uv build --wheel --out-dir dist +WHEEL=$(ls -1 dist/susser-*.whl | tail -n 1) +uv tool install "$WHEEL" + +# Resolve uv tool install location (Linux/macOS and Windows Git Bash) +SRC="" +APPDATA_U="" +if [ -n "${APPDATA:-}" ]; then + if command -v cygpath >/dev/null 2>&1; then + APPDATA_U="$(cygpath -u "$APPDATA")" + else + APPDATA_U="$APPDATA" + fi +fi + +if [ -d "$HOME/.local/share/uv/tools/susser/bin" ]; then + SRC="$HOME/.local/share/uv/tools/susser/bin" +elif [ -n "$APPDATA_U" ] && [ -d "$APPDATA_U/uv/tools/susser/Scripts" ]; then + SRC="$APPDATA_U/uv/tools/susser/Scripts" +elif [ -d "$HOME/AppData/Roaming/uv/tools/susser/Scripts" ]; then + SRC="$HOME/AppData/Roaming/uv/tools/susser/Scripts" +fi + +mkdir -p "$HOME/.local/bin" +if [ -n "$SRC" ]; then + if [ -f "$SRC/imview.exe" ]; then + cp -f "$SRC/imview.exe" "$HOME/.local/bin/imview.exe" + elif [ -f "$SRC/imview" ]; then + cp -f "$SRC/imview" "$HOME/.local/bin/imview" + chmod +x "$HOME/.local/bin/imview" + fi +fi + +case ":${PATH}:" in + *":$HOME/.local/bin:"*) ;; + *) export PATH="$HOME/.local/bin:$PATH" ;; +esac + +# Refresh shell command cache and print resolution +hash -r || true +which imview || true + +echo "imview installed to $HOME/.local/bin" \ No newline at end of file diff --git a/format.sh b/format.sh new file mode 100644 index 0000000..77bc5a1 --- /dev/null +++ b/format.sh @@ -0,0 +1,2 @@ +source .venv/Scripts/activate +wgo -debounce 20000ms -file .py clear :: black . \ No newline at end of file diff --git a/install_imview_context_menu.reg b/install_imview_context_menu.reg new file mode 100644 index 0000000..6b81b66 --- /dev/null +++ b/install_imview_context_menu.reg @@ -0,0 +1,7 @@ +Windows Registry Editor Version 5.00 + +[HKEY_CURRENT_USER\Software\Classes\SystemFileAssociations\image\shell\Open with imview] +@="Open with imview" + +[HKEY_CURRENT_USER\Software\Classes\SystemFileAssociations\image\shell\Open with imview\command] +@="C:\\Users\\administrator\\.local\\bin\\imview.exe \"%1\"" \ No newline at end of file diff --git a/uninstall_imview_context_menu.reg b/uninstall_imview_context_menu.reg new file mode 100644 index 0000000..16acc1c --- /dev/null +++ b/uninstall_imview_context_menu.reg @@ -0,0 +1,3 @@ +Windows Registry Editor Version 5.00 + +[-HKEY_CURRENT_USER\Software\Classes\SystemFileAssociations\image\shell\Open with imview] \ No newline at end of file