borgbackup/scripts/build-borg-using-pyinstaller.sh

22 lines
588 B
Bash
Executable file

#!/bin/bash
# Generate a single-file binary of borgbackup using PyInstaller.
set -euo pipefail
OUTPUT_DIR="dist/binary"
SPEC_FILE="scripts/borg.exe.spec"
echo "Building single-file binary of borgbackup using PyInstaller..."
# Run PyInstaller compilation
# We use -y/--noconfirm to overwrite the output directory without asking.
# We use --clean to clean PyInstaller cache and temporary files before building.
mkdir -p $OUTPUT_DIR
pyinstaller \
-y \
--clean \
--distpath="$OUTPUT_DIR" \
"$SPEC_FILE"
echo "Single-file binary generated at:"
echo "$OUTPUT_DIR/borg.exe"