borgbackup/scripts/build-borg-using-pyinstaller.sh
Thomas Waldmann 44e6ebdcd0
binary build scripts: use /bin/sh
there is no bash on some BSDs
2026-06-07 15:32:19 +02:00

22 lines
576 B
Bash
Executable file

#!/bin/sh
# Generate a single-file binary of borgbackup using PyInstaller.
set -eu
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"