diff options
| author | Leah Rowe <leah@libreboot.org> | 2024-05-22 23:11:12 +0100 | 
|---|---|---|
| committer | Leah Rowe <leah@libreboot.org> | 2024-05-22 23:11:12 +0100 | 
| commit | da4272720958f639227c7594018f840d1f693920 (patch) | |
| tree | 90f93286e46b164f91d2c20f8f3fbe5e9166ab0f | |
| parent | 093c4a367dc82e0c0690d9fba775bbcf5e7f3701 (diff) | |
git.sh: move repo copying to a new function
Signed-off-by: Leah Rowe <leah@libreboot.org>
| -rwxr-xr-x | include/git.sh | 13 | 
1 files changed, 9 insertions, 4 deletions
| diff --git a/include/git.sh b/include/git.sh index e7dfe591..569daeab 100755 --- a/include/git.sh +++ b/include/git.sh @@ -100,10 +100,7 @@ git_prep()  	[ "$xbmk_release" = "y" ] && [ "$_loc" != "src/$project/$project" ] \  	    && rmgit "$tmpgit" -	[ "$_loc" = "${_loc%/*}" ] || x_ mkdir -p "${_loc%/*}" -	mv "$tmpgit" "$_loc" || $err "git_prep: !mv $tmpgit $_loc" -	[ -n "$xtree" ] && [ ! -d "src/coreboot/$xtree" ] && \ -		x_ ./update trees -f coreboot "$xtree"; return 0 +	move_repo "$_loc"  }  prep_submodules() @@ -142,3 +139,11 @@ link_crossgcc()  	ln -s "../../$xtree/util/crossgcc" crossgcc || $err "$1: !xgcc link"  	) || $err "$1: !xgcc link"  } + +move_repo() +{ +	[ "$1" = "${1%/*}" ] || x_ mkdir -p "${1%/*}" +	mv "$tmpgit" "$1" || $err "git_prep: !mv $tmpgit $1" +	[ -n "$xtree" ] && [ ! -d "src/coreboot/$xtree" ] && \ +		x_ ./update trees -f coreboot "$xtree"; return 0 +} | 
