marlin-configs/build.sh
August 64bb632111
Some checks failed
Continuous Integration / Creality Ender 3 Pro - Check (push) Failing after 24s
Continuous Integration / FLSUN Kossel - Check (push) Failing after 21s
Fixing issues with build script
2026-11-08 18:58:38 +00:00

50 lines
951 B
Bash
Executable File

#!/usr/bin/env bash
set -ueo pipefail
if (( $# != 1 )); then
echo "Invalid CLI args."
echo "Usage:"
echo "./build.sh path/to/printer.env"
exit 1
fi
if ! [ -f "$1" ]; then
echo "Printer env file not found."
echo "Path: $1"
exit 1
fi
echo "Printer env file found: $1"
echo -n "Loading config variables... "
source "$1"
echo "OK"
filename="fw-${name// /_}-${board// /_}-ver$config_version.$fw_ext"
echo "Artifact name will be: ""$filename"""
if ! [ -d Marlin ]; then
git clone https://github.com/MarlinFirmware/Marlin --depth 1
cd Marlin
else
cd Marlin
git pull
fi
echo "Working directory: $PWD"
echo -n "Copying custom config files... "
cp "../$(dirname "$1")"/*.h Marlin/
echo "OK"
echo "Running PlatformIO build!"
pio run -e "$pio_env"
echo -n "Finished building. Copying firmware."$fw_ext"... "
mkdir -p ../output
cp .pio/build/"$pio_env"/firmware.$fw_ext ../output/"$filename"
echo "OK"
cd ..