Deployment Script with subfolders for each firmware version

This commit is contained in:
Knutwurst
2020-08-13 10:08:24 +02:00
parent f91882400b
commit 81ed8a1d9f
2 changed files with 8 additions and 8 deletions

View File

@@ -4,14 +4,14 @@ VERSION_FILE="/Users/OKoester/Documents/Arduino/Marlin-2-0-x-Anycubic-i3-MEGA-S-
FIRMWARE_FOLDER="/Users/OKoester/Documents/Arduino/Marlin-2-0-x-Anycubic-i3-MEGA-S-Master/.pio/build/"
OUTPUT_FOLDER="/Users/OKoester/Desktop/i3_FIRMWARE"
if [ -d "$OUTPUT_FOLDER" ]; then
echo "$OUTPUT_FOLDER already exists."
else
mkdir $OUTPUT_FOLDER
fi
CUSTOM_BUILD_VERSION=$(egrep -o "([0-9]{1,}\.)+[0-9]{1,}" $VERSION_FILE -m2 | tail -n1)
if [ -d "$$OUTPUT_FOLDER/v$CUSTOM_BUILD_VERSION" ]; then
echo "$$OUTPUT_FOLDER/$CUSTOM_BUILD_VERSION already exists."
else
mkdir $OUTPUT_FOLDER/$CUSTOM_BUILD_VERSION
fi
echo "Knutwurst's Mega Firmware Version: $CUSTOM_BUILD_VERSION"
cd $FIRMWARE_FOLDER
@@ -19,5 +19,5 @@ for dir in $FIRMWARE_FOLDER/*/
do
dir=${dir%*/}
echo ${dir##*/}
cp ${dir##*/}/firmware.hex /$OUTPUT_FOLDER/${dir##*/}_v$CUSTOM_BUILD_VERSION.hex
cp ${dir##*/}/firmware.hex /$OUTPUT_FOLDER/$CUSTOM_BUILD_VERSION/${dir##*/}_v$CUSTOM_BUILD_VERSION.hex
done