mirror of
https://github.com/dw-0/kiauh.git
synced 2025-12-17 04:24:29 +05:00
fix: rollback function
This commit is contained in:
@@ -1,24 +1,29 @@
|
||||
save_klipper_state(){
|
||||
source_ini
|
||||
#read current klipper state
|
||||
cd $KLIPPER_DIR
|
||||
COMMIT_STATE=$(git rev-parse --short HEAD)
|
||||
if [ $GET_BRANCH = origin/master ]; then
|
||||
if [ "$GET_BRANCH" = "origin/master" ]; then
|
||||
ORI_OLD=$previous_origin_state
|
||||
ORI_NEW=$COMMIT_STATE
|
||||
sed -i "/previous_origin_state=/s/$ORI_OLD/$ORI_NEW/" $INI_FILE
|
||||
elif [ $GET_BRANCH = dmbutyugin/scurve-shaping ]; then
|
||||
elif [ "$GET_BRANCH" = "origin" ]; then
|
||||
ORI_OLD=$previous_origin_state
|
||||
ORI_NEW=$COMMIT_STATE
|
||||
sed -i "/previous_origin_state=/s/$ORI_OLD/$ORI_NEW/" $INI_FILE
|
||||
elif [ "$GET_BRANCH" = "dmbutyugin/scurve-shaping" ]; then
|
||||
SHA_OLD=$previous_shaping_state
|
||||
SHA_NEW=$COMMIT_STATE
|
||||
sed -i "/previous_shaping_state=/s/$SHA_OLD/$SHA_NEW/" $INI_FILE
|
||||
elif [ $GET_BRANCH = dmbutyugin/scurve-smoothing ]; then
|
||||
elif [ "$GET_BRANCH" = "dmbutyugin/scurve-smoothing" ]; then
|
||||
SMO_OLD=$previous_smoothing_state
|
||||
SMO_NEW=$COMMIT_STATE
|
||||
sed -i "/previous_smoothing_state=/s/$SMO_OLD/$SMO_NEW/" $INI_FILE
|
||||
elif [ $GET_BRANCH = Arksine/work-web_server-20200131 ]; then
|
||||
elif [ "$GET_BRANCH" = "Arksine/work-web_server-20200131" ]; then
|
||||
WWS_OLD=$previous_moonraker_state
|
||||
WWS_NEW=$COMMIT_STATE
|
||||
sed -i "/previous_moonraker_state=/s/$WWS_OLD/$WWS_NEW/" $INI_FILE
|
||||
elif [ $GET_BRANCH = Arksine/dev-moonraker-testing ]; then
|
||||
elif [ "$GET_BRANCH" = "Arksine/dev-moonraker-testing" ]; then
|
||||
DMT_OLD=$previous_dev_moonraker_state
|
||||
DMT_NEW=$COMMIT_STATE
|
||||
sed -i "/previous_dev_moonraker_state=/s/$DMT_OLD/$DMT_NEW/" $INI_FILE
|
||||
@@ -29,15 +34,15 @@ load_klipper_state(){
|
||||
source_ini
|
||||
print_branch
|
||||
CURR_COMM=$(git rev-parse --short=8 HEAD)
|
||||
if [ "$GET_BRANCH" == "origin/master" ]; then
|
||||
if [ "$GET_BRANCH" = "origin/master" ]; then
|
||||
PREV_COMM=$previous_origin_state
|
||||
elif [ "$GET_BRANCH" == "dmbutyugin/scurve-shaping" ]; then
|
||||
elif [ "$GET_BRANCH" = "dmbutyugin/scurve-shaping" ]; then
|
||||
PREV_COMM=$previous_shaping_state
|
||||
elif [ "$GET_BRANCH" == "dmbutyugin/scurve-smoothing" ]; then
|
||||
elif [ "$GET_BRANCH" = "dmbutyugin/scurve-smoothing" ]; then
|
||||
PREV_COMM=$previous_smoothing_state
|
||||
elif [ "$GET_BRANCH" == "Arksine/work-web_server-20200131" ]; then
|
||||
elif [ "$GET_BRANCH" = "Arksine/work-web_server-20200131" ]; then
|
||||
PREV_COMM=$previous_moonraker_state
|
||||
elif [ "$GET_BRANCH" == "Arksine/dev-moonraker-testing" ]; then
|
||||
elif [ "$GET_BRANCH" = "Arksine/dev-moonraker-testing" ]; then
|
||||
PREV_COMM=$previous_dev_moonraker_state
|
||||
fi
|
||||
PREV_COMM_DATE=$(git show -s --format=%cd --date=short $PREV_COMM)
|
||||
|
||||
Reference in New Issue
Block a user