Skip to content

Commit 3d09675

Browse files
halfmanbearEternalNoobletBeattuneBeattune
authored
Dev to Main (#342)
* Remove UNLOAD_FILAMENT from the default config. Addresses issue #335 (#336) * feat: Add automatic firmware branch detection (KLIPPER / KALICO) (#341) * feat: Add automatic firmware branch detection (KLIPPER / KALICO) * feat: Add automatic firmware branch detection (KLIPPER / KALICO) * feat: Add automatic firmware branch detection (KLIPPER / KALICO) --------- Co-authored-by: Beattune <beattune-github@e-mail.de> * Reduce sleep duration after git pull commands --------- Co-authored-by: EternalNooblet <67196335+EternalNooblet@users.noreply.github.com> Co-authored-by: Beattune <60428301+Beattune@users.noreply.github.com> Co-authored-by: Beattune <beattune-github@e-mail.de>
1 parent ca22bad commit 3d09675

2 files changed

Lines changed: 32 additions & 2 deletions

File tree

img-config/rpi-mcu-install.sh

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,17 @@ apply_minimal_config() {
1414
make olddefconfig
1515
}
1616

17+
# Get current git branch from $KLIPPER_DIR
18+
cd "$KLIPPER_DIR" || exit 1
19+
current_branch=$(git rev-parse --abbrev-ref HEAD)
20+
21+
# Check for detached HEAD status
22+
if [[ "$current_branch" == "HEAD" ]]; then
23+
echo "Warning: Detached HEAD state detected!"
24+
sleep 30
25+
exit 1
26+
fi
27+
1728
# Prompt user for MCU if not passed as argument
1829
if [[ -z $1 ]]; then
1930
echo ""
@@ -33,7 +44,27 @@ else
3344
fi
3445

3546
# Update Klipper
36-
cd "$KLIPPER_DIR" && git pull origin master
47+
cd "$KLIPPER_DIR" || exit 1
48+
pull_output=$(git pull origin "$current_branch" 2>&1)
49+
pull_exit=$?
50+
51+
# Check for git pull errors
52+
if [[ $pull_exit -ne 0 ]]; then
53+
echo -e "\n❌ Git pull failed for '$current_branch'!"
54+
echo "$pull_output"
55+
sleep 20
56+
exit 1
57+
fi
58+
59+
# Generate and show response message
60+
if echo "$pull_output" | grep -iq "already up to date"; then
61+
echo -e "\nℹ️ Branch '$current_branch' is already up to date."
62+
sleep 5
63+
else
64+
echo -e "\n✅ Git pull successful for '$current_branch':"
65+
echo "$pull_output"
66+
sleep 5
67+
fi
3768

3869
### STM32 MCU UPDATE ###
3970
if [[ "$mcu_choice" == "STM32" || "$mcu_choice" == "All" ]]; then

printer-confs/base.cfg

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,6 @@ gcode:
225225
description: Pause for colour change
226226
gcode:
227227
PAUSE
228-
UNLOAD_FILAMENT
229228

230229
[gcode_macro LOAD_FILAMENT]
231230
variable_prev_temp: 0

0 commit comments

Comments
 (0)