Initial commit: Bulk Renamer with AppImage build and Gitea push notes
Made-with: Cursor
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
#!/usr/bin/env bash
|
||||
# Build Bulk Renamer as an AppImage.
|
||||
# Requires: pip install -r requirements.txt -r requirements-build.txt
|
||||
# Optional: appimagetool from https://github.com/AppImage/AppImageKit/releases (for building the final .AppImage)
|
||||
|
||||
set -e
|
||||
cd "$(dirname "$0")"
|
||||
APP_NAME="BulkRenamer"
|
||||
APPDIR="${APP_NAME}.AppDir"
|
||||
EXE_NAME="$APP_NAME"
|
||||
|
||||
echo "=== Installing build deps ==="
|
||||
pip install -q -r requirements.txt -r requirements-build.txt
|
||||
|
||||
echo "=== Running PyInstaller ==="
|
||||
pyinstaller --noconfirm --onedir --windowed \
|
||||
-n "$EXE_NAME" \
|
||||
--hidden-import=engine \
|
||||
--hidden-import=engine.rules \
|
||||
--hidden-import=engine.pipeline \
|
||||
--hidden-import=gui \
|
||||
--hidden-import=gui.main_window \
|
||||
--hidden-import=gui.rule_widgets \
|
||||
main.py
|
||||
|
||||
echo "=== Creating AppDir ==="
|
||||
rm -rf "$APPDIR"
|
||||
mkdir -p "$APPDIR/usr/bin"
|
||||
cp -a "dist/$EXE_NAME" "$APPDIR/usr/bin/"
|
||||
|
||||
cat > "$APPDIR/AppRun" << 'EOF'
|
||||
#!/bin/sh
|
||||
SELF=$(readlink -f "$0")
|
||||
HERE=${SELF%/*}
|
||||
exec "$HERE/usr/bin/BulkRenamer/BulkRenamer" "$@"
|
||||
EOF
|
||||
chmod +x "$APPDIR/AppRun"
|
||||
|
||||
cat > "$APPDIR/bulk-renamer.desktop" << 'EOF'
|
||||
[Desktop Entry]
|
||||
Name=Bulk Renamer
|
||||
Comment=Mass rename files with preview and flexible rules
|
||||
Exec=BulkRenamer
|
||||
Icon=bulk-renamer
|
||||
Type=Application
|
||||
Categories=Utility;FileTools;
|
||||
EOF
|
||||
|
||||
echo "=== Building AppImage (requires appimagetool) ==="
|
||||
if command -v appimagetool &>/dev/null; then
|
||||
appimagetool "$APPDIR" "${APP_NAME}-${VERSION:-dev}.AppImage" 2>/dev/null || \
|
||||
appimagetool "$APPDIR" "${APP_NAME}.AppImage"
|
||||
echo "Done: ${APP_NAME}.AppImage (or ${APP_NAME}-dev.AppImage)"
|
||||
else
|
||||
echo "AppDir is ready at $APPDIR/"
|
||||
echo "To create the .AppImage, install appimagetool and run:"
|
||||
echo " appimagetool $APPDIR ${APP_NAME}.AppImage"
|
||||
echo " # Get it from: https://github.com/AppImage/AppImageKit/releases"
|
||||
fi
|
||||
Reference in New Issue
Block a user