Compare commits

...

3 Commits

Author SHA1 Message Date
Nick Berardi
40c4a0384c Merge 89a9d38d39 into d800d356ca 2024-03-26 10:09:04 +01:00
dw-0
d800d356ca fix(backups): backup config folder only if it exists
Signed-off-by: Dominik Willner <th33xitus@gmail.com>
2024-03-24 19:45:02 +01:00
Nick Berardi
89a9d38d39 trim klipper git clone to only latest history 2024-01-01 15:03:40 -05:00
2 changed files with 12 additions and 10 deletions

View File

@@ -43,6 +43,7 @@ function backup_config_dir() {
local i=0 folder folder_name target_dir local i=0 folder folder_name target_dir
for folder in ${config_pathes}; do for folder in ${config_pathes}; do
if [[ -d ${folder} ]]; then
status_msg "Create backup of ${folder} ..." status_msg "Create backup of ${folder} ..."
folder_name=$(echo "${folder}" | rev | cut -d"/" -f2 | rev) folder_name=$(echo "${folder}" | rev | cut -d"/" -f2 | rev)
@@ -52,6 +53,7 @@ function backup_config_dir() {
i=$(( i + 1 )) i=$(( i + 1 ))
ok_msg "Backup created in:\n${target_dir}" ok_msg "Backup created in:\n${target_dir}"
fi
done done
else else
ok_msg "No config directory found! Skipping backup ..." ok_msg "No config directory found! Skipping backup ..."

View File

@@ -264,7 +264,7 @@ function clone_klipper() {
status_msg "Cloning Klipper from ${repo} ..." status_msg "Cloning Klipper from ${repo} ..."
cd "${HOME}" || exit 1 cd "${HOME}" || exit 1
if git clone "${repo}" "${KLIPPER_DIR}"; then if git clone "${repo}" "${KLIPPER_DIR}" --depth 1; then
cd "${KLIPPER_DIR}" && git checkout "${branch}" cd "${KLIPPER_DIR}" && git checkout "${branch}"
else else
print_error "Cloning Klipper from\n ${repo}\n failed!" print_error "Cloning Klipper from\n ${repo}\n failed!"