feat(deploy): add croppa installation and context menu integration
This commit is contained in:
29
deploy.sh
29
deploy.sh
@@ -10,8 +10,17 @@ uv build --wheel --out-dir dist
|
|||||||
WHEEL=$(ls -1 dist/grader-*.whl | tail -n 1)
|
WHEEL=$(ls -1 dist/grader-*.whl | tail -n 1)
|
||||||
uv tool install "$WHEEL"
|
uv tool install "$WHEEL"
|
||||||
|
|
||||||
|
# Build and install croppa
|
||||||
|
cd croppa
|
||||||
|
uv tool uninstall croppa >/dev/null 2>&1 || true
|
||||||
|
uv build --wheel --out-dir dist
|
||||||
|
CROPPA_WHEEL=$(ls -1 dist/croppa-*.whl | tail -n 1)
|
||||||
|
uv tool install "$CROPPA_WHEEL"
|
||||||
|
cd ..
|
||||||
|
|
||||||
# Resolve uv tool install location (Linux/macOS and Windows Git Bash)
|
# Resolve uv tool install location (Linux/macOS and Windows Git Bash)
|
||||||
SRC=""
|
SRC=""
|
||||||
|
CROPPA_SRC=""
|
||||||
APPDATA_U=""
|
APPDATA_U=""
|
||||||
if [ -n "${APPDATA:-}" ]; then
|
if [ -n "${APPDATA:-}" ]; then
|
||||||
if command -v cygpath >/dev/null 2>&1; then
|
if command -v cygpath >/dev/null 2>&1; then
|
||||||
@@ -29,6 +38,14 @@ elif [ -d "$HOME/AppData/Roaming/uv/tools/grader/Scripts" ]; then
|
|||||||
SRC="$HOME/AppData/Roaming/uv/tools/grader/Scripts"
|
SRC="$HOME/AppData/Roaming/uv/tools/grader/Scripts"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -d "$HOME/.local/share/uv/tools/croppa/bin" ]; then
|
||||||
|
CROPPA_SRC="$HOME/.local/share/uv/tools/croppa/bin"
|
||||||
|
elif [ -n "$APPDATA_U" ] && [ -d "$APPDATA_U/uv/tools/croppa/Scripts" ]; then
|
||||||
|
CROPPA_SRC="$APPDATA_U/uv/tools/croppa/Scripts"
|
||||||
|
elif [ -d "$HOME/AppData/Roaming/uv/tools/croppa/Scripts" ]; then
|
||||||
|
CROPPA_SRC="$HOME/AppData/Roaming/uv/tools/croppa/Scripts"
|
||||||
|
fi
|
||||||
|
|
||||||
mkdir -p "$HOME/.local/bin"
|
mkdir -p "$HOME/.local/bin"
|
||||||
if [ -n "$SRC" ]; then
|
if [ -n "$SRC" ]; then
|
||||||
if [ -f "$SRC/grader.exe" ]; then
|
if [ -f "$SRC/grader.exe" ]; then
|
||||||
@@ -39,6 +56,15 @@ if [ -n "$SRC" ]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -n "$CROPPA_SRC" ]; then
|
||||||
|
if [ -f "$CROPPA_SRC/croppa.exe" ]; then
|
||||||
|
cp -f "$CROPPA_SRC/croppa.exe" "$HOME/.local/bin/croppa.exe"
|
||||||
|
elif [ -f "$CROPPA_SRC/croppa" ]; then
|
||||||
|
cp -f "$CROPPA_SRC/croppa" "$HOME/.local/bin/croppa"
|
||||||
|
chmod +x "$HOME/.local/bin/croppa"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
case ":${PATH}:" in
|
case ":${PATH}:" in
|
||||||
*":$HOME/.local/bin:"*) ;;
|
*":$HOME/.local/bin:"*) ;;
|
||||||
*) export PATH="$HOME/.local/bin:$PATH" ;;
|
*) export PATH="$HOME/.local/bin:$PATH" ;;
|
||||||
@@ -47,5 +73,6 @@ esac
|
|||||||
# Refresh shell command cache and print resolution
|
# Refresh shell command cache and print resolution
|
||||||
hash -r || true
|
hash -r || true
|
||||||
which grader || true
|
which grader || true
|
||||||
|
which croppa || true
|
||||||
|
|
||||||
echo "grader installed to $HOME/.local/bin"
|
echo "grader and croppa installed to $HOME/.local/bin"
|
@@ -11,3 +11,9 @@ Windows Registry Editor Version 5.00
|
|||||||
|
|
||||||
[HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\Grade media with grader\command]
|
[HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\Grade media with grader\command]
|
||||||
@="C:\\Users\\administrator\\.local\\bin\\grader.exe \"%V\""
|
@="C:\\Users\\administrator\\.local\\bin\\grader.exe \"%V\""
|
||||||
|
|
||||||
|
[HKEY_CURRENT_USER\Software\Classes\*\shell\Edit with croppa]
|
||||||
|
@="Edit with croppa"
|
||||||
|
|
||||||
|
[HKEY_CURRENT_USER\Software\Classes\*\shell\Edit with croppa\command]
|
||||||
|
@="C:\\Users\\administrator\\.local\\bin\\croppa.exe \"%1\""
|
@@ -3,3 +3,5 @@ Windows Registry Editor Version 5.00
|
|||||||
[-HKEY_CURRENT_USER\Software\Classes\Directory\shell\Grade media with grader]
|
[-HKEY_CURRENT_USER\Software\Classes\Directory\shell\Grade media with grader]
|
||||||
|
|
||||||
[-HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\Grade media with grader]
|
[-HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\Grade media with grader]
|
||||||
|
|
||||||
|
[-HKEY_CURRENT_USER\Software\Classes\*\shell\Edit with croppa]
|
21
uv.lock
generated
21
uv.lock
generated
@@ -2,6 +2,27 @@ version = 1
|
|||||||
revision = 3
|
revision = 3
|
||||||
requires-python = ">=3.13"
|
requires-python = ">=3.13"
|
||||||
|
|
||||||
|
[manifest]
|
||||||
|
members = [
|
||||||
|
"croppa",
|
||||||
|
"grader",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "croppa"
|
||||||
|
version = "0.1.0"
|
||||||
|
source = { virtual = "croppa" }
|
||||||
|
dependencies = [
|
||||||
|
{ name = "numpy" },
|
||||||
|
{ name = "opencv-python" },
|
||||||
|
]
|
||||||
|
|
||||||
|
[package.metadata]
|
||||||
|
requires-dist = [
|
||||||
|
{ name = "numpy", specifier = ">=1.24.0" },
|
||||||
|
{ name = "opencv-python", specifier = ">=4.8.0" },
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "grader"
|
name = "grader"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
|
Reference in New Issue
Block a user