Skip to content

Commit

Permalink
Remove doubled slash from patch logs
Browse files Browse the repository at this point in the history
  • Loading branch information
ChillerDragon committed Oct 12, 2024
1 parent e810fd5 commit e628c75
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions lib/include/update/git_patches.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

shopt -s extglob # used for trailing slashes globbing

# gets overwritten if patches are applied
# absolute paths to the patch files
# that were succesfully applied on last
Expand All @@ -8,11 +10,16 @@ _APPLIED_GIT_PATCHES=()

_patch_dir_absolute() {
[ "$CFG_GIT_PATCHES_DIR" = "" ] && return
if [ "${CFG_GIT_PACTHES_DIR::1}" = / ]

local dir
# strip trailing slashes
dir="${CFG_GIT_PATCHES_DIR%%+(/)}"

if [ "${dir::1}" = / ]
then
printf '%s' "$CFG_GIT_PATCHES_DIR"
printf '%s' "$dir"
else
printf '%s/%s' "$SCRIPT_ROOT" "$CFG_GIT_PATCHES_DIR"
printf '%s/%s' "$SCRIPT_ROOT" "$dir"
fi
}

Expand Down

0 comments on commit e628c75

Please sign in to comment.